From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Do not hardcode PG_PROTOCOL_LATEST in NegotiateProtocolVersion
Date: Thu, 15 Aug 2024 14:45:26 +0000
Message-ID: <E1sebjC-004IJo-3Y@gemulon.postgresql.org> (raw)
Do not hardcode PG_PROTOCOL_LATEST in NegotiateProtocolVersion
We shouldn't ask the client to use a protocol version later than the
one that they requested. To avoid that, if the client requests a
version newer than the latest one we support, set FrontendProtocol
to the latest version we support, not the requested version. Then,
use that value when building the NegotiateProtocolVersion message.
(It seems good on general principle to avoid setting FrontendProtocol
to a version we don't support, anyway.)
None of this really matters right now, because we only support a
single protocol version, but if that ever changes, we'll need this.
Jelte Fennema-Nio, reviewed by me and incorporating some of my
proposed wording
Discussion: https://postgr.es/m/CAGECzQTyXDNtMXdq2L-Wp=OvOCPa07r6+U_MGb==h90MrfT+fQ@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/516b87502dc1f99adb5126aa70cc796d53648c92
Modified Files
--------------
src/backend/tcop/backend_startup.c | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: rhaas@postgresql.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Do not hardcode PG_PROTOCOL_LATEST in NegotiateProtocolVersion
In-Reply-To: <E1sebjC-004IJo-3Y@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox