[PATCH] Correct the version sent in protocol negotiation
Ning Sun <classicning@gmail.com>
From: Ning Sun <classicning@gmail.com>
To: pgsql-docs@lists.postgresql.org
Date: 2026-06-07T02:00:09Z
Lists: pgsql-docs
Attachments
- 0001-Protocol-negotiation-sends-full-version-instead-of-m.patch (text/x-patch) patch 0001
Our protocol doc describes protocol negotiation message will send latest
minor version. However that field is a 4-byte one. The actual
implementation sends full version including the major part:
static void
SendNegotiateProtocolVersion(List *unrecognized_protocol_options)
{
StringInfoData buf;
ListCell *lc;
pq_beginmessage(&buf, PqMsg_NegotiateProtocolVersion);
pq_sendint32(&buf, FrontendProtocol);
pq_sendint32(&buf, list_length(unrecognized_protocol_options));
foreach(lc, unrecognized_protocol_options)
pq_sendstring(&buf, lfirst(lc));
pq_endmessage(&buf);
/* no need to flush, some other message will follow */
}
The patch included just clarifies this behavior by removing "minor" from
"newest minor version".