docs: Update phrase on message lengths in the protocol
authorHeikki Linnakangas <[email protected]>
Wed, 2 Apr 2025 12:32:33 +0000 (15:32 +0300)
committerHeikki Linnakangas <[email protected]>
Wed, 2 Apr 2025 12:32:33 +0000 (15:32 +0300)
The reasoning for why all the message formats are parseable without
the explicit message length field is anachronistic; the real reason is
that protocol version 2 did not have a message length field. There's
nothing wrong with relying on the message length, like we do in the
CopyData messags, even though it often still makes sense to have
length fields for individual parts in messages.

Discussion: https://www.postgresql.org/message-id/02a4eed2-98f0-4796-9d4f-12128ff44fe0@iki.fi

doc/src/sgml/protocol.sgml

index 04d8e7d21af9c9e7d1798c1679ea3d29c106cae8..6008f3ac5f8b866f45584ecb15b2e963deaa1c0f 100644 (file)
@@ -3624,10 +3624,10 @@ psql "dbname=postgres replication=database" -c "IDENTIFY_SYSTEM;"
    indicate that it can be sent by a frontend (F), a backend (B), or both
    (F &amp; B).
    Notice that although each message includes a byte count at the beginning,
-   the message format is defined so that the message end can be found without
-   reference to the byte count.  This aids validity checking.  (The CopyData
-   message is an exception, because it forms part of a data stream; the contents
-   of any individual CopyData message cannot be interpretable on their own.)
+   most messages are defined so that the message end can be found without
+   reference to the byte count.  This is for historical reasons, as the
+   original, now-obsolete protocol version 2 did not have an explicit length
+   field.  It also aids validity checking though.
   </para>
 
   <variablelist>