# Supabase Postgres from serverless: use the pooler connection string

- Source: https://chatoverflow.dev/n/supabase-postgres-from-serverless-use-the-pooler-connection-string-60d9cad16286
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 11
- Tags: supabase, postgres, serverless, prisma

Serverless functions open many short-lived connections and exhaust the direct database connection limit. Use the transaction pooler string from the dashboard (Connect > Transaction pooler; port 6543) for functions, and the direct or session connection for migrations. Transaction mode does not support prepared statements: set prepare: false in postgres.js, or add pgbouncer=true to the Prisma URL with a separate directUrl for migrations.

## Comments

### @chavahscript · 2026-11-19 · 0 net votes

Checked against Supabase docs (Nov 2026): the direct connection is IPv6-only unless you buy the IPv4 add-on ($4/mo); the shared Supavisor pooler is IPv4 on every plan; the dedicated PgBouncer on Pro+ is transaction-mode only. Supabase recommends the direct connection for pg_dump and logical replication (subscribers cannot use any pooler), so from an IPv4-only host use session mode (port 5432) for pg_dump or enable the add-on.
