How to Set Up CI/CD with ParadeDB in PostgreSQL

Galaxy Glossary

How do I set up a CI/CD pipeline for ParadeDB in PostgreSQL?

ParadeDB CI/CD automates building, testing, and deploying a PostgreSQL instance running the ParadeDB extension across environments.

Sign up for the latest in SQL knowledge from the Galaxy Team!
Welcome to the Galaxy, Guardian!
Oops! Something went wrong while submitting the form.

Description

Table of Contents

Why use CI/CD for ParadeDB?

Automated pipelines catch schema issues early, guarantee extension compatibility, and ship new search features to prod with one click.

Which tools integrate best?

GitHub Actions, GitLab CI, and CircleCI all run ParadeDB in Docker images. Use Flyway or sqitch for migrations and pgTAP for tests.

How do I containerize ParadeDB?

# Dockerfile
FROM paradedb/paradedb:latest
ENV POSTGRES_PASSWORD=postgres
COPY ./sql /docker-entrypoint-initdb.d

Place migration scripts in sql/. The image auto-executes them on start.

How do I write a GitHub Actions workflow?

# .github/workflows/ci.yml
name: ParadeDB CI
on: [push]
jobs:
test:
runs-on: ubuntu-latest
services:
db:
image: paradedb/paradedb:latest
ports: ["5432:5432"]
env:
POSTGRES_PASSWORD: postgres
steps:
- uses: actions/checkout@v3
- name: Install psql
run: sudo apt-get install -y postgresql-client
- name: Run migrations
run: psql -h localhost -U postgres -f sql/001_init.sql
- name: Run pgTAP tests
run: psql -h localhost -U postgres -f test/all_tests.sql

The pipeline builds, migrates, and runs unit tests on every push.

How do I promote to production?

Add a deploy job triggered on main merges that runs the same migrations against the prod database using a secret connection string.

What parameters matter?

Set PARADEDB_MAX_MEMORY and PARADEDB_MAX_WORKERS via ALTER SYSTEM SET in a migration file to keep prod and staging identical.

Best practice: use transactional migrations?

Wrap CREATE EXTENSION paradedb and config changes in a single transaction to avoid partial deploys.

Best practice: seed reference data

Load small product catalogs or test customers inside the pipeline so integration tests mimic production queries.

Why How to Set Up CI/CD with ParadeDB in PostgreSQL is important

How to Set Up CI/CD with ParadeDB in PostgreSQL Example Usage


-- Find top 5 products matching 'wireless headphones' using ParadeDB full-text search
SELECT id, name, price
FROM Products
WHERE to_tsvector('simple', name) @@ plainto_tsquery('wireless headphones')
ORDER BY ts_rank_cd(to_tsvector('simple', name), plainto_tsquery('wireless headphones')) DESC
LIMIT 5;

How to Set Up CI/CD with ParadeDB in PostgreSQL Syntax


-- Install ParadeDB extension
CREATE EXTENSION IF NOT EXISTS paradedb;

-- Tune ParadeDB settings (restart not required)
ALTER SYSTEM SET paradedb.max_memory = '2GB';
ALTER SYSTEM SET paradedb.max_workers = 8;

-- Example pipeline command sequence
psql -h $HOST -d $DB -U $USER -c "CREATE EXTENSION paradedb;"
psql -h $HOST -d $DB -U $USER -f sql/001_create_tables.sql
psql -h $HOST -d $DB -U $USER -f sql/002_create_indexes.sql

-- Ecommerce context: create a vector index for fast product search
CREATE INDEX idx_products_name_vector
  ON Products USING parade_vector (to_tsvector('simple', name));

Common Mistakes

Frequently Asked Questions (FAQs)

Can ParadeDB run in the same container as my app?

Yes, but separate containers improve scaling and isolate resource spikes from intensive search queries.

Do I need superuser to install ParadeDB?

Yes. Grant superuser in the CI container or use a privileged role just for the installation migration.

How do I roll back a bad ParadeDB migration?

Use transactional migrations plus ON_ERROR_STOP=1 so CI fails early. Rollbacks in production can be handled by Flyway undo scripts.

Want to learn about other SQL terms?

Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie Logo
Bauhealth Logo
Truvideo Logo
Welcome to the Galaxy, Guardian!
Oops! Something went wrong while submitting the form.