Changes to the Heroku PgBouncer buildpack
Change effective on 09 June 2026
We updated the Heroku PgBouncer buildpack to support the new PGBOUNCER_CONNECT_QUERY configuration variable. Use this configuration variable to specify a SQL query that PgBouncer executes on every new server connection. PGBOUNCER_CONNECT_QUERY ensures that session-level parameters like statement_timeout persist even when PgBouncer rotates backend connections.
This configuration variable is useful for apps that set session parameters at connect time but lose those settings when PgBouncer transparently replaces the underlying PostgreSQL connection. Configure this setting via the PGBOUNCER_CONNECT_QUERY config var.
For more details, see Client-Side Postgres Connection Pooling or the buildpack’s documentation.