Skip to content

Commit 85d799b

Browse files
committed
docs: Update phrase on message lengths in the protocol
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
1 parent a6285b1 commit 85d799b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

doc/src/sgml/protocol.sgml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3624,10 +3624,10 @@ psql "dbname=postgres replication=database" -c "IDENTIFY_SYSTEM;"
36243624
indicate that it can be sent by a frontend (F), a backend (B), or both
36253625
(F & B).
36263626
Notice that although each message includes a byte count at the beginning,
3627-
the message format is defined so that the message end can be found without
3628-
reference to the byte count. This aids validity checking. (The CopyData
3629-
message is an exception, because it forms part of a data stream; the contents
3630-
of any individual CopyData message cannot be interpretable on their own.)
3627+
most messages are defined so that the message end can be found without
3628+
reference to the byte count. This is for historical reasons, as the
3629+
original, now-obsolete protocol version 2 did not have an explicit length
3630+
field. It also aids validity checking though.
36313631
</para>
36323632

36333633
<variablelist>

0 commit comments

Comments
 (0)