Connect Postgres

Connect your warehouse

Connect Postgres

Console: Sidebar Connections → Connect customer database


What Connections does

  1. Tests TCP/Postgres from the control plane API (not your browser)
  2. Saves credentials encrypted in the control plane
  3. Syncs connection to your workspace analytics runtime (Superset REST)

Failure before save → red error under the form. Save OK but sync fails → 502 (often public HTTPS or runtime login).


Allowlist IPs (copy from UI)

Customer database must allow both:

SourceUsed for
API egress IPConnection test + sync
Runtime EC2 IPChart queries after sync

Shown on the connect form. API: GET /data-sources/egress-ips (Clerk auth).

Until stable NAT is enabled, ECS egress IP may change on redeploy — re-check allowlist after platform deploys.


Customer / DBA checklist

  1. listen_addresses — not 127.0.0.1 only (ss -lntp | grep 5432)
  2. pg_hba.conf — allow both Embedded Canvas IPs; use hostssl when SSL = require
  3. Security group / firewall — inbound TCP 5432 from both IPs
  4. Read-only role — SELECT on required schemas
  5. Tenant column on fact tables — validate ≥2 test tenant ids with different rows
  6. Runtime public HTTPS OK (Operator console runtime health) before sync

Connect form fields

FieldNotes
Connection nameUnique per workspace; becomes Superset database label
Host / port / databaseCustomer Postgres or pooler host
Username / passwordRead-only user
SSLrequire (production) · disable (private demo only)

Supabase Session pooler

Direct db.<project>.supabase.co often resolves to IPv6 — our API may fail with ENETUNREACH. Use Session pooler from Supabase Connect:

FieldExample pattern
Hostaws-1-us-east-2.pooler.supabase.com (copy exact shard from Connect)
Port5432
Userpostgres.<project-ref> or role.<project-ref>
Databasepostgres
SSLrequire

Do not mix pooler shards (e.g. nc to aws-1 but psql to aws-0).

Test from runtime EC2 before connecting:

psql "host=<pooler-host> port=5432 dbname=postgres user=postgres.<ref> sslmode=require" -c 'SELECT 1'

Add EC2 public IP + API egress IP in Supabase Network restrictions.


Common errors

MessageFix
Connection refusedPostgres on localhost only; nothing on 5432
TimeoutFirewall / SG / Supabase network restrictions
Password authentication failedUser, password, or pg_hba
ENETUNREACH + IPv6Use Session pooler host
tenant/user … not found (pooler)Wrong pooler shard or username format
502 after green testRuntime public HTTPS; check API logs

Re-sync

Credentials already saved but runtime out of date:

  • Analytics → Re-sync only, or
  • POST /data-sources/:id/sync-to-runtime

Deep reference