Re: [PATCH v1] command_tag_format — protocol-level command tag negotiation via _pq_ - Mailing list pgsql-hackers

From Andres Freund
Subject Re: [PATCH v1] command_tag_format — protocol-level command tag negotiation via _pq_
Date
Msg-id mgrurx4o6icyqhi4oniflwltrvoetfs62pmhhn3bnj24jao46a@q5pe2oqdjqva
Whole thread
In response to [PATCH v1] command_tag_format — protocol-level command tag negotiation via _pq_  (nik@postgres.ai)
Responses Re: [PATCH v1] command_tag_format — protocol-level command tag negotiation via _pq_
List pgsql-hackers
Hi,

On 2026-03-11 21:22:14 +0000, nik@postgres.ai wrote:
> PostgreSQL has had a protocol feature negotiation framework since
> 7.4 (the _pq_ namespace in startup parameters) -- over 20 years --
> but it's never been used in practice.

Wasn't that added in

commit ae65f6066dc
Author: Robert Haas <rhaas@postgresql.org>
Date:   2017-11-21 13:56:24 -0500

    Provide for forward compatibility with future minor protocol versions.

    Previously, any attempt to request a 3.x protocol version other than
    3.0 would lead to a hard connection failure, which made the minor
    protocol version really no different from the major protocol version
    and precluded gentle protocol version breaks.  Instead, when the
    client requests a 3.x protocol version where x is greater than 0, send
    the new NegotiateProtocolVersion message to convey that we support
    only 3.0.  This makes it possible to introduce new minor protocol
    versions without requiring a connection retry when the server is
    older.

PG 14 / 2017 is quite a while after 7.4...



>
>   legacy  - INSERT 0 N  (default, fully backward compatible)
>   verbose - INSERT tablename N
>   fqn     - INSERT schema.tablename N

Pretty doubtful this survives the complexity / gain tradeoff.



Separately, doing extra work during command handling isn't free either. We've
spent a decent amount of effort in the past lowering it, see e.g.

commit ac998020802
Author: David Rowley <drowley@postgresql.org>
Date:   2022-12-16 10:31:25 +1300

    Speed up creation of command completion tags


I'm loathe to add work to every statement.


Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Add documentation for PG_ABS_SRCDIR, PG_ABS_BUILDDIR, PG_LIBDIR, PG_DLSUFFIX
Next
From: Jeff Davis
Date:
Subject: Re: Change initdb default to the builtin collation provider