Re: Add new protocol message to change GUCs for usage with future protocol-only GUCs
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Jelte Fennema-Nio <me@jeltef.nl>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Dave Cramer <davecramer@gmail.com>,
Jacob Burroughs <jburroughs@instructure.com>, "Andrey M. Borodin" <x4mmm@yandex-team.ru>,
Pavel Stehule <pavel.stehule@gmail.com>, Jeff Davis <pgsql@j-davis.com>, Peter Eisentraut <peter@eisentraut.org>
Date: 2024-01-02T17:51:24Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
libpq: Add min/max_protocol_version connection options
- 285613c60a7a 18.0 landed
-
libpq: Handle NegotiateProtocolVersion message differently
- 5070349102af 18.0 landed
-
Add PQfullProtocolVersion() to surface the precise protocol version.
- cdb6b0fdb0b2 18.0 landed
-
Do not hardcode PG_PROTOCOL_LATEST in NegotiateProtocolVersion
- 516b87502dc1 18.0 landed
-
libpq: Handle NegotiateProtocolVersion message
- bbf9c282ce92 16.0 cited
-
Provide for forward compatibility with future minor protocol versions.
- ae65f6066dc3 11.0 cited
On Fri, Dec 29, 2023 at 1:38 PM Tom Lane <tgl@sss.pgh.pa.us> wrote: > Jelte Fennema-Nio <me@jeltef.nl> writes: > > 1. Protocol messages are much easier to inspect for connection poolers > > than queries > > Unless you somehow forbid clients from setting GUCs in the old way, > exactly how will that help a pooler? I agree that for this to work out we need the things that you can set this way to be able to be set in only this way. But I'm also a huge fan of the idea -- if done correctly, it would solve the problem of an end client sneaking SET ROLE or SET SESSION AUTHORIZATION past the pooler, which is a huge issue that we really ought to address. > > 2. It paves the way for GUCs that can only be set using a protocol > > message (and not using SET). > > This is assuming facts not in evidence. Why would we want such a thing? See above. > > 3. Being able to change GUCs while in an aborted transaction. > > I'm really dubious that that's sane. How will it interact with, for > example, changes to the same GUC done in the now-failed transaction? > Or for that matter, changes that happen later in the current > transaction? It seems like you can't even think about this unless > you deem GUC changes made this way to be non-transactional, which > seems very wart-y and full of consistency problems. I agree with these complaints. > > 4. Have an easy way to use the value contained in a ParameterStatus > > message as the value for a GUC > > I agree that GUC_LIST_QUOTE is a mess, but "I'm too lazy to deal > with that" seems like a rather poor argument for instead expending > the amount of labor involved in a protocol change. Not sure about this one. It seems unwarranted to introduce an accusation of laziness when someone is finally making the effort to address what is IMV a pretty serious deficiency in our current implementation, but I have no educated opinion about what if anything ought to be done about GUC_LIST_QUOTE or how that relates to the present effort. > On the whole, this feels like you are trying to force some things > into the GUC model that should not be there. I do perceive that > there are things that could be protocol-level variables, but > trying to say they are a kind of GUC seems like it will create > more problems than it solves. This is not a bad thought. If we made the things that were settable with this mechanism distinct from the set of things that are settable as GUCs, that might work out better. For example, it completely the objection to (3). But I'm not 100% sure, either. -- Robert Haas EDB: http://www.enterprisedb.com