Re: Add new protocol message to change GUCs for usage with future protocol-only GUCs

From: Jelte Fennema-Nio <me(at)jeltef(dot)nl>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Dave Cramer <davecramer(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jacob Burroughs <jburroughs(at)instructure(dot)com>, "Andrey M(dot) Borodin" <x4mmm(at)yandex-team(dot)ru>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Peter Eisentraut <peter(at)eisentraut(dot)org>
Subject: Re: Add new protocol message to change GUCs for usage with future protocol-only GUCs
Date: 2024-01-02 14:57:37
Message-ID: CAGECzQQwnfdMeLKSCOaYMqPMCWmg1mfPCxhin6dLfpzSZ2ScsQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, 30 Dec 2023 at 00:07, Jelte Fennema-Nio <me(at)jeltef(dot)nl> wrote:
>
> On Fri, 29 Dec 2023 at 19:32, Jeff Davis <pgsql(at)j-davis(dot)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

Attachment Content-Type Size
v2-0003-Bump-protocol-version-to-3.1.patch application/x-patch 1.6 KB
v2-0001-libpq-Handle-NegotiateProtocolVersion-message-mor.patch application/x-patch 8.9 KB
v2-0004-Add-support-to-change-GUCs-at-the-protocol-level.patch application/x-patch 23.1 KB
v2-0002-libpq-Include-minor-version-number-in-PQprotocolV.patch application/x-patch 3.3 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Verite 2024-01-02 14:58:14 Re: psql's FETCH_COUNT (cursor) is not being respected for CTEs
Previous Message Robert Haas 2024-01-02 14:41:17 Re: Things I don't like about \du's "Attributes" column