Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

introduce PGBOUNCER_CONNECT_QUERY parameter to configure connect_query setting #95

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

igorwwwwwwwwwwwwwwwwwwww

TLDR: this is super useful for setting things like statement_timeout on backend connection initiation.

Backstory:

We are running pgbouncer in statement pooling mode. We were setting statement_timeout on connection start in activerecord, to make sure we don't have lingering long-running queries. But for some reason we had a really bad query almost take down the database, so we started to investigate.

Long story short: As soon as pgbouncer re-creates its connections (by default at least once every hour), they do not have statement_timeout (and other session-level props) set.

This patch allows defining a query to execute after pgbouncer creates a new backend connection.

@valeriecodes valeriecodes changed the base branch from master to main August 7, 2020 21:14
nixme added a commit to FatbearLabs/heroku-buildpack-pgbouncer that referenced this pull request Jan 27, 2024
Squashed version of #1 and
heroku#95 to make
patches easier to carry forward.
nixme added a commit to FatbearLabs/heroku-buildpack-pgbouncer that referenced this pull request Jan 27, 2024
Squashed version of #1 and
heroku#95 to make
patches easier to carry forward.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant