No credit cardStart free

PostgreSQL

Connect to any PostgreSQL database — self-hosted, AWS RDS, Supabase, Neon, or any Postgres-compatible service.

Configuration

FieldRequiredDescription
hostYesDatabase host (e.g., localhost, db.example.com)
portYesPort number (default: 5432)
databaseYesDatabase name
userYesDatabase user
passwordYesDatabase password
ssl_modeNoSSL mode: disable, allow, prefer (default), require. Use require for cloud-hosted databases.

Query Mode

PostgreSQL supports both Sync and Live mode. Choose during connection setup:

  • Sync - Copies data to the Iceberg lakehouse. Fast local queries, historical data.
  • Live - Queries your Postgres directly via DuckDB's postgres_scanner. Always fresh, no sync delay.

See Live Mode for trade-offs and details.

Synced Tables

In sync mode, we sync all tables in the public schema by default. Tables are synced with their original names:

sql
-- If your Postgres has tables: users, orders, products
-- And you name the connection "mydb"
SELECT * FROM mydb.users;
SELECT * FROM mydb.orders;
SELECT * FROM mydb.products;

Network Access

Your database must be accessible from our servers. Options:

Supabase

Supabase uses connection pooling. Use the Session Mode connection string from your Supabase dashboard (Settings → Database → Connection string).

bash
rq connections create my-supabase --type postgres \
-p host=aws-0-us-east-1.pooler.supabase.com \
-p port=5432 \
-p database=postgres \
-p user=postgres.your_project_ref \
-p password=your_db_password \
-p ssl_mode=require

The user format is postgres.your_project_ref (not just postgres). You'll find your project ref in the Supabase dashboard URL or in Settings → General.

Neon, RDS, Cloud SQL

Any managed Postgres works the same way. Use the host, port, user, and password from your provider's dashboard, and set ssl_mode=require.

Recommended Setup

For self-hosted Postgres, create a read-only user:

sql
CREATE USER rawquery WITH PASSWORD 'secure_password';
GRANT CONNECT ON DATABASE mydb TO rawquery;
GRANT USAGE ON SCHEMA public TO rawquery;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO rawquery;
ALTER DEFAULT PRIVILEGES IN SCHEMA public
GRANT SELECT ON TABLES TO rawquery;