-
Notifications
You must be signed in to change notification settings - Fork 137
Add PGBOUNCER_MAX_PREPARED_STATEMENTS
config
#199
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
Add PGBOUNCER_MAX_PREPARED_STATEMENTS
config
#199
Conversation
Hi - thank you for the PR!
I'm not on the Heroku Data team (so I'll leave it to them to properly review), but have occasionally contributed to this buildpack in the past. I don't think regenerating those *.tgz is needed for this change - and also we'd need to run the regeneration ourselves due to the risk of accepting potentially arbitrary binaries. So perhaps omit those changes for now? :-) |
0e3e4bd
to
a1ba9a7
Compare
Hi @edmorley, thanks for your comment! It makes sense not to rely on a third-party to regenerate those. I've removed the commit responsible for updating the *.tgz files. Hopefully this can get reviewed & merged soon! |
a1ba9a7
to
3ed987b
Compare
@habovh I will take a look at this by the end of the week. Main thing this is missing is tests - adding an extension to |
@mble-sfdc ask and you shall receive. I've updated the test suite to include this new configuration. |
Also just so everyone is reassured about the default value, here's an excerpt from the
As you can see, the default value for Edit: my local version was indeed 1.24.x with the new default. |
@habovh many thanks for the testing. The default value of 200 was added in pgbouncer 1.24.0, so that is likely why you are seeing it - this buildpack currently uses 1.23.1. You'll need to add an entry to
Then we should be all good. |
@mble-sfdc added the suggested entry to the changelog and updated my previous message as well as you pointed out 1.24 brought this new default. |
This all looks good to me. @mble-sfdc do you feel good about merging this? |
@habovh we will need to do a formal release, but you can set your app to use the buildpack from |
@mble-sfdc awesome, I'll keep using my fork until you guys release an update, but I'm thrilled this got merged! Happy to contribute and I hope this will help people looking to optimize their db connections |
Following issues I had when using this buildpack with Prisma ORM and prepared statements, I am suggesting these changes to add support for
max_prepared_statements
configuration on pgbouncer.As it turns out, it seems that if not set, the default value would be 0. This is an issue when using transaction pooling mode, and prevents from using prepared statements in that case.
Giving control to the user on this important configuration seems appropriate, keeping the default value at zero to avoid breaking changes, basically making it an opt-in config.
I updated the *.tgz files but I'm not sure this was needed as I'm not familiar with how build packs work, maybe the changes to
bin/gen-pgbouncer-conf.sh
were enough. Let me know so I can update my branch accordingly.Relevant issues:
CODE: 26000 ERROR: prepared statement \"PGBOUNCER_34\" does not exist
prisma/prisma#21877