[PATCH] Correct the version sent in protocol negotiation

From: Ning Sun <classicning(at)gmail(dot)com>
To: pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: [PATCH] Correct the version sent in protocol negotiation
Date: 2026-06-07 02:00:09
Message-ID: 065b1b54-dc4a-4a29-919d-76f89ce96532@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-docs

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

Attachment Content-Type Size
0001-Protocol-negotiation-sends-full-version-instead-of-m.patch text/x-patch 1.5 KB

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Laurenz Albe 2026-06-07 05:06:55 Re: [PATCH] Correct the version sent in protocol negotiation
Previous Message Daniel Gustafsson 2026-06-04 22:21:41 Re: pg_checksums docs mentioning online functions