Re: Add new protocol message to change GUCs for usage with future protocol-only GUCs
Jacob Burroughs <jburroughs@instructure.com>
From: Jacob Burroughs <jburroughs@instructure.com>
To: Jelte Fennema-Nio <me@jeltef.nl>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>,
Dave Cramer <davecramer@gmail.com>, Robert Haas <robertmhaas@gmail.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: 2023-12-30T15:05:27Z
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
> How about instead of talking about protocol-only GUCs (which are > indeed currently a theoretical concept), we start considering this > patch as a way to modify parameters for protocol extensions. Protocol > extension parameters (starting with _pq_.) can currently only be > configured using the StartupMessage and afterwards there is no way to > modify them. > > I believe [1], [2] and [3] from my initial email could all use such > protocol extension parameters, if those parameters could be changed > after the initial startup. What if we allowed the client to send `ParameterStatus` messages to the server to reconfigure protocol extensions that were requested at startup? Such processing would be independent of the transaction lifecycle since protocol-level options aren't related to transactions. Any errors in the set value would be handled with an `ErrorResponse` (including if an extension was not reconfigurable after connection startup), and success with a new `ReadyForQuery` message. The actual effect of an extension change must be delayed until after the ReadyForQuery has been transmitted, though I don't know if that is feasible or if we would need to instead implicitly assume changes were successful and just close the connection on error. We wouldn't need to bump the protocol version since a client wouldn't (shouldn't) send these messages unless it successfully negotiated the relevant protocol extension(s) at startup.