- Symptom
- prepared statement "s0" already existsErrors appear only under concurrent load, not in local testspostgres.js queries hang or return rows meant for another query
- Cause
- Transaction mode hands the connection back to the pool after each transaction, so per-session state such as prepared statements and pipelined queries leaks between clients. Most drivers prepare statements by default.
- Fix
- Turn off prepared statements in the driver when using port 6543, or use session mode or a direct connection for code that needs them, including migrations.
- Apply
# Prisma DATABASE_URL="postgres://...pooler.supabase.com:6543/postgres?pgbouncer=true" DIRECT_URL="postgres://...pooler.supabase.com:5432/postgres" // postgres.js / Drizzle const sql = postgres(process.env.DATABASE_URL, { prepare: false });- Affected
- Supabase Supavisor transaction mode (port 6543) with Prisma, postgres.js, Drizzle, asyncpg, JDBC
- Sources
Last verified 2026-10-15 · Confirmed by 0 builders