# Postgres error 42P05: prepared statement "s0" already exists

> The driver tried to create a named prepared statement that already exists on this server connection.

Source: https://scribase.com/postgres-errors/42p05

SQLSTATE class: Syntax Error or Access Rule Violation. Over PostgREST/supabase-js this maps to HTTP 400.

## Causes

- A transaction-mode connection pooler (such as PgBouncer in transaction mode) handed the same server connection to different clients, and their prepared statement names collided.
- A driver that names statements reusing names after a reconnect.

## Fixes

- Turn off named prepared statements in the driver when using a transaction pooler (Prisma: pgbouncer=true; node-postgres: do not set a statement name; psycopg: prepare_threshold=None).
- Or connect in session mode / directly for workloads that need prepared statements.