Fix
pg_dump fails through Supabase's Transaction Pooler
Port 6543 is transaction-mode pooling, historically fatal to pg_dump. Modern Supavisor has narrowed the gap — here is what actually happens, tested.
The symptoms
ERROR: prepared statement "pg_dump_..." does not exist
— or a dump that hangs, or —
pg_dump: error: server closed the connection unexpectedly
What we measured (2026-09-04)
We ran a full pg_dump + restore drill against a live Supabase project through port 6543: a small dump succeeded. Supavisor now speaks protocol-level prepared statements, so the classic instant failure is gone. Our guidance stands regardless: use the Session Pooler (5432) for backups — transaction pooling still reassigns connections and exposes long-running dumps to pool timeouts and rotation, and Supabase's own docs point maintenance tools at 5432.
Why the errors happen when they do
In transaction mode, the pooler hands your client a different backend connection for each transaction. Anything that relies on session state breaks: prepared statements, SET parameters, and the consistent snapshot pg_dump holds for the whole run. This is by design; transaction mode exists to serve thousands of short app queries, not maintenance tools.
The fix: same host, port 5432
The Session Pooler keeps one backend per client for the life of the connection, which is exactly what pg_dump, pg_restore, and migration tools need:
| Pooler | Port | Use for |
|---|---|---|
| Transaction | 6543 | Your app's queries (serverless, high concurrency) |
| Session | 5432 | pg_dump, pg_restore, migrations, psql sessions |
pg_dump -Fc -f backup.dump \
"postgresql://postgres.<PROJECT_REF>:<PASSWORD>@aws-0-<REGION>.pooler.supabase.com:5432/postgres"
If you were on 6543 because the direct connection was unreachable, that is the IPv6 issue — covered here. The Session Pooler solves both at once.
Backups that prove they restore
pgProof handles the pooler details for you, then restore-tests every backup in a disposable container and emails the proof. Failures alert immediately, not the night you need the backup.
Join the early-access waitlist