Menu

1 / 2

Why pg_dump Fails on Supabase's Transaction Pooler — Use the Session Pooler (5432)

DEV Community: postgres·william lao·1 day ago
#h5AWZoke
#devtopostgresql#devto#dev#pooler#session
Reading 0:00
15s threshold

If you're setting up an automated backup for a Supabase project, the first connection string you meet is the wrong one for the job. This post explains why, and which one to use instead.

The symptom

You copy the connection string from Settings → Database in the Supabase dashboard, plug it into your backup script or CI job, and run pg_dump . Then one of these happens:

The dump hangs until it times out.

It dies partway through with an error that mentions prepared statements, or a setting that "does not exist", or nothing recognisable at all.

It works once from your laptop and fails in CI, or the other way around.

The credentials are fine. The network is fine. The port is the problem.

What's actually going on

The prominent connection option in the dashboard is the transaction pooler , on port 6543 . Supabase's pooler is PgBouncer, and in transaction mode it works like this: your client connects, runs a statement, and the pooler is free to hand the next statement to a different backend connection.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.