On Tue Oct 7, 2025 at 6:08 PM CEST, Dmitry Igrishin wrote:
CancelRequest(F) documentation at https://www.postgresql.org/docs/18/protocol-message-formats.html#PROTOCOL-MESSAGE-FORMATS-CANCELREQUEST seems to be inconsistent for protocol 3.2. It is stated here that the length of the message is always 16 bytes (specified as Int32(16)), however the maximum message length actually depends on the secret key length (which can be up to 256 bytes, as also stated in the documentation.)
Good catch. Attached is a patch that fixes this.
From 5506c574e976eb40174820668a00f02e9b4b62f4 Mon Sep 17 00:00:00 2001 From: Jelte Fennema-Nio <[email protected]> Date: Mon, 13 Oct 2025 11:52:22 +0200 Subject: [PATCH v1] docs: Fix protocol version 3.2 message format of CancelRequest Since protocol version 3.2 the CancelRequest does not have a fixed size length anymore. The protocol docs still listed the length field to be a constant number though. This fixes that. Reported-by: Dmitry Igrishin <[email protected]> Backpatch-through: 18 --- doc/src/sgml/protocol.sgml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml index b5395604fb8..9d755232873 100644 --- a/doc/src/sgml/protocol.sgml +++ b/doc/src/sgml/protocol.sgml @@ -4327,7 +4327,7 @@ psql "dbname=postgres replication=database" -c "IDENTIFY_SYSTEM;" <listitem> <variablelist> <varlistentry> - <term>Int32(16)</term> + <term>Int32</term> <listitem> <para> Length of message contents in bytes, including self. base-commit: 7a662a46ebf74e9fa15cb62b592b4bf00c96fc94 -- 2.51.0
