Re: Add new protocol message to change GUCs for usage with future protocol-only GUCs
Jelte Fennema-Nio <me@jeltef.nl>
From: Jelte Fennema-Nio <me@jeltef.nl>
To: Jeff Davis <pgsql@j-davis.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>,
Dave Cramer <davecramer@gmail.com>, Robert Haas <robertmhaas@gmail.com>,
Jacob Burroughs <jburroughs@instructure.com>, "Andrey M. Borodin" <x4mmm@yandex-team.ru>,
Pavel Stehule <pavel.stehule@gmail.com>, Peter Eisentraut <peter@eisentraut.org>
Date: 2024-01-02T14:57:37Z
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
Attachments
- v2-0003-Bump-protocol-version-to-3.1.patch (application/x-patch) patch v2-0003
- v2-0001-libpq-Handle-NegotiateProtocolVersion-message-mor.patch (application/x-patch) patch v2-0001
- v2-0004-Add-support-to-change-GUCs-at-the-protocol-level.patch (application/x-patch) patch v2-0004
- v2-0002-libpq-Include-minor-version-number-in-PQprotocolV.patch (application/x-patch) patch v2-0002
On Sat, 30 Dec 2023 at 00:07, Jelte Fennema-Nio <me@jeltef.nl> wrote: > > On Fri, 29 Dec 2023 at 19:32, Jeff Davis <pgsql@j-davis.com> wrote: > > That is my biggest concern right now: what will new clients connecting > > to old servers do? > > This is not that big of a deal. Since it's only an addition of a new > message type, it's completely backwards compatible with the current > protocol version. i.e. as long as a client just doesn't send it when > the server reports an older protocol version everything works fine. > The protocol already has version negotiation built in and the server > implements it in a reasonable way. The only problem is that no-one > bothered to implement the client side of it in libpq, because it > wasn't necessary yet since 3.x only had a single minor version. > > Patch v20230911-0003[5] from thread [3] implements client side > handling in (imho) a sane way. Okay I updated this patchset to start with better handling of the NegotiateProtocolVersion packet. The implementation is quite different from [5] after all, but the core idea is the same. It also allows the connection to continue to work in case of a missing protocol extension, which is necessary for the libpq compression patchset[6]. In case the protocol extension is a requirement, the client can still choose to disconnect by checking the return value of the newly added PQunsupportedProtocolExtensions function. I also fixed the tests of my final patch, but haven't changed the behaviour of it in any of the suggested ways. [3]: https://www.postgresql.org/message-id/flat/AB607155-8FED-4C8C-B702-205B33884CBB%40yandex-team.ru#961c695d190cdccb3975a157b22ce9d8