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
Make varcache (the pg parameters cached per connection) dynamically configurable. #867
Conversation
This is the 2nd patch that is proposing to include uthash. I'm wondering if, for maintenance reason, it would be interesting to include this code into the tree. It is another task to do before releasing a new PgBouncer version. It is also hard to track bugs in this code. Let's not be responsible to this code unless it is no longer maintained. My suggestion is to create another submodule (like libusual). Should Regarding the
It means there is an list that is part of tracked parameters but these parameters aren't part of the default value. These parameters are part of an implementation detail but your PR is exposing it but keeping the original part hidden. If I was proposing such feature I wouldn't use 2 lists. Instead, use only a dynamic list and the default value is the current list. I would also add a check to avoid someone from removing the original list (I don't have a strong opinion if we should allow removing some of these original parameters from the list.) |
I totally agree with using a submodule for uthash instead of vendoring the file in.
I think submodule in submodule sounds like a recipe for problems.
I think for the usecase in this PR the one from libusual would be fine too (to clarify I mean this one: https://github.com/libusual/libusual/blob/master/usual/hashtab-impl.h). But for the prepared statement one the one from libusual is way too basic (e.g. the hash tables from libusual are fixed size). So for that one we'll need uthash anyway. I'm a bit on the fence for this, because of two competing considerations:
I think consideration 2 weighs more heavily for me, given the fact that we'll quite likely want to introduce uthash for the prepared statements PR. Which is why I also suggested using uthash to @emelsimsek (also because I thought that this PR also needed a growable hashtable, but that's not actually the case)
Without changing the So while I agree two lists is a bit confusing and might not seem very clean from a code design perspective. On the other hand, from a user perspective it seems quite annoying to be forced to prefix a value in your config with a (pretty long) required list. For instance only adding
The main advantage of doing this seems to me having the possibility to allow removal from this list in the future. I'll think a bit longer if I think that's worth the configuration hassle. |
This is actually in line with What do you think about the name In fact IntervalStyle is not a startup parameter. Should we rename |
It's allowed to specify any Postgres command line parameter in the `options` startup packet #867. This is commonly used to specify GUC values on connection startup, using the `-c key=value` command line flag. I believe the main reason this is used instead of specifying the desired GUC as a startup parameter directly is because libpq does not allow specifying arbitrary startup parameters. This PR adds support for configuring GUCs using the `-c` flag in the options startup packet. While in theory people can specify any flag they want. In practice the `-c` flag is the only one that I know is commonly used. Probably because it is the only one that's documented in the Postgres docs for `PGOPTIONS`. Any of the other command line flags are simply shorthands for specific GUCs, and so even when those would be used they can be easily rewritten using `-c`. So to keep parsing of the options startup parameter simple, this only supports the `-c` flag. Fixes #875
This reverts commit 8c18fc4.
This reverts commit 8c18fc4.
Does this mean I can run |
If you have the Citus extension installed and have set |
This change enables caching other postgres parameters in addition to the static list
{"client_encoding", "DateStyle", "TimeZone", "standard_conforming_strings", "application_name"}
that is already supported.Testing:
Add
track_extra_parameters
in *.ini file to enable caching search_path per connection.Related to #452 and #482
Fixes #470
Fixes #821