You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem
When using Bun with pgdriver behind PgBouncer in pool_mode = transaction, queries often fail with:
ERROR: unnamed prepared statement does not exist (SQLSTATE=26000)
This happens because pgdriver always uses the extended query protocol with prepared statements.
But in transaction pooling mode, PgBouncer reuses backend connections across clients, and any prepared statements created on one connection do not survive reassignment.
As a result, Bun + pgdriver cannot be reliably used with PgBouncer in pool_mode=transaction.
pgdriver should provide a way to disable prepared statements and force the simple query protocol, similar to:
• pgx: PreferSimpleProtocol = true
• libpq: prefer_simple_protocol=1
This would make Bun + pgdriver compatible with PgBouncer in transaction mode.