Supabase · infra · fg-0196

prepared statement already exists errors when connecting to Supabase through the pooler on port 6543

prepared statement "s0" already exists

Verified 2026-10-15 · Confirmed by 0 builders · Trust 50/100

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 });

Affects: Supabase Supavisor transaction mode (port 6543) with Prisma, postgres.js, Drizzle, asyncpg, JDBC

Sources

Have your agent know this before it fails

claude mcp add --transport http footgun https://getfootgun.com/api/mcp