Postgres Protocol Message Formats Clarification

Started by PG Bug reporting form5 days ago2 messagesdocs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/18/protocol-message-formats.html
Description:

While the docs correctly state here
(https://www.postgresql.org/docs/current/protocol-overview.html#PROTOCOL-MESSAGE-CONCEPTS)
that the size bytes represent the length of the message except the first
byte (the msg type byte), this page
(https://www.postgresql.org/docs/current/protocol-message-formats.html#PROTOCOL-MESSAGE-FORMATS)
which explicitly describes the message formats does not include this
clarification.

Readers who come across this page without reading the protocol overview page
will be quite confused should they try to implement the protocol and see
short by one message sizes.

I propose that this clarification be more explicitly added to the message
formats page to avoid confusing readers.

#2David G. Johnston
david.g.johnston@gmail.com
In reply to: PG Bug reporting form (#1)
Re: Postgres Protocol Message Formats Clarification

On Sat, Jul 11, 2026 at 10:58 AM PG Doc comments form <
noreply@postgresql.org> wrote:

While the docs correctly state here
(
https://www.postgresql.org/docs/current/protocol-overview.html#PROTOCOL-MESSAGE-CONCEPTS
)
that the size bytes represent the length of the message

It states it's the length of the "message contents". That the leading byte
is a header and not content seems reasonably implied - otherwise the field
would just be 'the length of the message' and there would be no need to
even clarify that the length field itself is included in the count.

David J.