Hi,
This patch clarifies the format of the major and minor protocol version
numbers sent by the backend in a NegotiateProtocolVersion message. The
current wording "Newest minor protocol version supported by the server
for the major protocol version requested by the client" can be read as
indicating that the Int32 field only includes the minor protocol version
number, where in fact the backend sends an Int16 with the major protocol
version then an Int16 with the newest minor protocol version that it
supports.
Thanks,
Eric Marsden
From 204e8c709da6bf2982c88c5ba5b050b4382f3268 Mon Sep 17 00:00:00 2001
From: Eric Marsden <[email protected]>
Date: Mon, 8 Sep 2025 09:53:24 +0200
Subject: [PATCH] doc: protocol major.minor numbers in NegotiateProtocolVersion
message
Improve the documentation of the major and minor protocol version numbers that
are sent in a NegotiateProtocolVersion message.
---
doc/src/sgml/protocol.sgml | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml
index b539560..f2d05a1 100644
--- a/doc/src/sgml/protocol.sgml
+++ b/doc/src/sgml/protocol.sgml
@@ -5328,11 +5328,22 @@ psql "dbname=postgres replication=database" -c "IDENTIFY_SYSTEM;"
</varlistentry>
<varlistentry>
- <term>Int32</term>
+ <term>Int16</term>
+ <listitem>
+ <para>
+ The major protocol version used for this connection. Given that the
+ NegotiateProtocolVersion message was introduced in protocol version 3,
+ this will be 3 or greater.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Int16</term>
<listitem>
<para>
- Newest minor protocol version supported by the server
- for the major protocol version requested by the client.
+ Newest minor protocol version supported by the server for the major
+ protocol version requested by the client.
</para>
</listitem>
</varlistentry>
@@ -5348,7 +5359,7 @@ psql "dbname=postgres replication=database" -c "IDENTIFY_SYSTEM;"
</variablelist>
<para>
- Then, for protocol option not recognized by the server, there
+ Then, for each protocol option not recognized by the server, there
is the following:
</para>
--
2.51.0