NegotiateProtocolVersion description

Started by Tatsuo Ishii6 months ago5 messages
#1Tatsuo Ishii
ishii@postgresql.org

In the docs (54.7. Message Formats) NegotiateProtocolVersion message's
third field is described as below:

"Newest minor protocol version supported by the server for the major
protocol version requested by the client. "

From the description initially I thought the field value is minor
protocol version (e.g. 0, 2). However I realized that it's actually
protocol major version plus protocol minor version, like
StartupMessage. Probably my misunderstanding is due to my limited
English ability, but I just want to make sure that the current
description definitely matches what the field actually represents.

Best regards,
--
Tatsuo Ishii
SRA OSS K.K.
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp

#2David G. Johnston
david.g.johnston@gmail.com
In reply to: Tatsuo Ishii (#1)
Re: NegotiateProtocolVersion description

On Saturday, July 5, 2025, Tatsuo Ishii <ishii@postgresql.org> wrote:

In the docs (54.7. Message Formats) NegotiateProtocolVersion message's
third field is described as below:

"Newest minor protocol version supported by the server for the major
protocol version requested by the client. "

From the description initially I thought the field value is minor
protocol version (e.g. 0, 2). However I realized that it's actually
protocol major version plus protocol minor version, like
StartupMessage. Probably my misunderstanding is due to my limited
English ability, but I just want to make sure that the current
description definitely matches what the field actually represents.

Add an example? I like the wording as-is, though I can see your point. I
wouldn’t expect the returned value to be a fragment of a version in this
context so minor just emphasizes that the client is applying a filter on
the major version it supports. I’d be ok with removing “minor” altogether.

David J.

#3Fujii Masao
masao.fujii@oss.nttdata.com
In reply to: Tatsuo Ishii (#1)
Re: NegotiateProtocolVersion description

On 2025/07/05 19:30, Tatsuo Ishii wrote:

In the docs (54.7. Message Formats) NegotiateProtocolVersion message's
third field is described as below:

"Newest minor protocol version supported by the server for the major
protocol version requested by the client. "

From the description initially I thought the field value is minor
protocol version (e.g. 0, 2). However I realized that it's actually
protocol major version plus protocol minor version, like
StartupMessage. Probably my misunderstanding is due to my limited
English ability, but I just want to make sure that the current
description definitely matches what the field actually represents.

A similar issue was discussed, and a patch was proposed in [1]/messages/by-id/CADK3HH+KkTFkv3zhJ9Koqmkyj=n2XG=CDp-MxAhMOPoezaQwoQ@mail.gmail.com.
That thread might be worth reading.

Regards,

[1]: /messages/by-id/CADK3HH+KkTFkv3zhJ9Koqmkyj=n2XG=CDp-MxAhMOPoezaQwoQ@mail.gmail.com

--
Fujii Masao
NTT DATA Japan Corporation

#4Tatsuo Ishii
ishii@postgresql.org
In reply to: David G. Johnston (#2)
Re: NegotiateProtocolVersion description

Add an example? I like the wording as-is, though I can see your point. I
wouldn’t expect the returned value to be a fragment of a version in this
context so minor just emphasizes that the client is applying a filter on
the major version it supports. I’d be ok with removing “minor” altogether.

Probably not necessary to remove "minor". It seems our document
consistently uses "minor protocol version" to mean the whole protocol
version, not a fragment.

Followings are my understanding;

major version (number):
The most significant 16 bits of the protocol version (i.e. 3)

minor version (number):
The least significant 16 bits of the protocol version (i.e. 2)

major protocol version:
The major version part of the protocol version. Only used in
NegotiateProtocolVersion.

minor protocol version:
The whole protocol version including minor version (3.2)

Best regards,
--
Tatsuo Ishii
SRA OSS K.K.
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp

#5Tatsuo Ishii
ishii@postgresql.org
In reply to: Fujii Masao (#3)
Re: NegotiateProtocolVersion description

A similar issue was discussed, and a patch was proposed in [1].
That thread might be worth reading.

Thanks. I will take a look at it.

Best regards,
--
Tatsuo Ishii
SRA OSS K.K.
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp