public inbox for [email protected]  
help / color / mirror / Atom feed
CancelRequest(F) documentation.
3+ messages / 3 participants
[nested] [flat]

* CancelRequest(F) documentation.
@ 2025-10-07 16:08  Dmitry Igrishin <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Dmitry Igrishin @ 2025-10-07 16:08 UTC (permalink / raw)
  To: [email protected]

Hello,

CancelRequest(F) documentation at
https://www.postgresql.org/docs/18/protocol-message-formats.html#PROTOCOL-MESSAGE-FORMATS-CANCELREQU...
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.)

I would propose to specify the overall message length as Int32 in the
documentation for PostgreSQL 18+.

Thanks.





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: CancelRequest(F) documentation.
@ 2025-10-13 09:57  Jelte Fennema-Nio <[email protected]>
  parent: Dmitry Igrishin <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Jelte Fennema-Nio @ 2025-10-13 09:57 UTC (permalink / raw)
  To: Dmitry Igrishin <[email protected]>; [email protected]

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-CANCELREQU...
> 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.


Attachments:

  [text/x-patch] v1-0001-docs-Fix-protocol-version-3.2-message-format-of-C.patch (1.1K, 2-v1-0001-docs-Fix-protocol-version-3.2-message-format-of-C.patch)
  download | inline diff:
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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: CancelRequest(F) documentation.
@ 2025-10-13 13:33  Magnus Hagander <[email protected]>
  parent: Jelte Fennema-Nio <[email protected]>
  0 siblings, 0 replies; 3+ messages in thread

From: Magnus Hagander @ 2025-10-13 13:33 UTC (permalink / raw)
  To: Jelte Fennema-Nio <[email protected]>; +Cc: Dmitry Igrishin <[email protected]>; [email protected]

On Mon, 13 Oct 2025 at 11:57, Jelte Fennema-Nio <[email protected]> wrote:

> 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-CANCELREQU...
> > 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.
>

Thanks, pushed!

-- 
 Magnus Hagander
 Me: https://www.hagander.net/ <http://www.hagander.net/;
 Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/;


^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2025-10-13 13:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-10-07 16:08 CancelRequest(F) documentation. Dmitry Igrishin <[email protected]>
2025-10-13 09:57 ` Jelte Fennema-Nio <[email protected]>
2025-10-13 13:33   ` Magnus Hagander <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox