I set max_prepared_statements = 1 in PgBouncer and attempted to create multiple prepared statements within a single transaction.
Expected Behavior:
PgBouncer should either prevent more than one prepared statement from being created, OR It should immediately delete the prepared statement after committing the transaction.
Actual Behavior:
PgBouncer allowed multiple prepared statements to be created and executed, even with max_prepared_statements set to 1.
Has anyone else encountered this issue? Is this the expected behavior, or am I missing a configuration setting?
PGBouncer: 1.21v PostgreSQL: 14.3v Pool mode: Transaction
pgbounceraccounts for prepared statements. 2) JDBC is just a driver, it does not say anything about how you are using prepared statements. 3) Look at the Postgres logs and see what is actually hitting the database. That with the information in 1) above should help you track down the issue.