Re: Add new protocol message to change GUCs for usage with future protocol-only GUCs
Jelte Fennema-Nio <postgres@jeltef.nl>
From: Jelte Fennema-Nio <postgres@jeltef.nl>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Jacob Champion <jacob.champion@enterprisedb.com>,
Heikki Linnakangas <hlinnaka@iki.fi>, Tom Lane <tgl@sss.pgh.pa.us>, Jacob Burroughs <jburroughs@instructure.com>, Dave Cramer <davecramer@gmail.com>, Peter Smith <smithpb2250@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, "Andrey M. Borodin" <x4mmm@yandex-team.ru>,
Pavel Stehule <pavel.stehule@gmail.com>, Jeff Davis <pgsql@j-davis.com>, Peter Eisentraut <peter@eisentraut.org>, Daniele Varrazzo <daniele.varrazzo@gmail.com>
Date: 2024-08-19T07:29:59Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
libpq: Add min/max_protocol_version connection options
- 285613c60a7a 18.0 landed
-
libpq: Handle NegotiateProtocolVersion message differently
- 5070349102af 18.0 landed
-
Add PQfullProtocolVersion() to surface the precise protocol version.
- cdb6b0fdb0b2 18.0 landed
-
Do not hardcode PG_PROTOCOL_LATEST in NegotiateProtocolVersion
- 516b87502dc1 18.0 landed
-
libpq: Handle NegotiateProtocolVersion message
- bbf9c282ce92 16.0 cited
-
Provide for forward compatibility with future minor protocol versions.
- ae65f6066dc3 11.0 cited
On Mon, 19 Aug 2024 at 05:44, Robert Haas <robertmhaas@gmail.com> wrote: > I feel like what you're really complaining about here is that libpq is > not properly versioned. We've just been calling it libpq.so.5 forever > instead of bumping the version number when we change stuff. There is PQlibVersion() that can be used for this. Which has existed since 2010, so people can assume it exists. > I just don't see why this particular change is special. I didn't mean to say that it was, and I don't think the problem is enormous either. I mainly meant to say that there is not just a cost to Postgres maintainers when we introduce a new API. There's definitely a cost to users and client authors too. > Also, I kind of wish you had brought this argument up earlier. Maybe > you did and I missed it, but I was under the impression that you were > just arguing that "nobody will notice or care," which is a quite > different argument than what you make here. "nobody will notice or care" was definitely my argument before Jacob responded. Since Jacob his response I realize there are two valid use cases for PQprotocolVersion(): 1. Feature detection. For this my argument still is: people won't notice. Many people won't have bothered to use the function and everyone else will have used >= 3 here. 2. Pinning the protocol version, because they care that the exact protocol details are the same. Here people will have used == 3, and thus their check will fail when we start to return a different version from PQprotocolVersion(). But that's actually what this usecase desires. By creating a new function, we actually break the expectation of these people: i.e. they want the PQprotocolVersion() to return a different version when the protocol changes. Before Jacob responded I only considered the first case. So my argument was indeed basically: Let's reuse this currently useless function with the nice name, because no-one will care. But if people thought that the risk was too high, I didn't see huge downsides to introducing a new API either. But **now I actually feel much more strongly about reusing the same function**. Because by introducing a new function we actually break the users of the second use-case. P.S. The docs for PQprotocolVersion[1] have never said that this function only returns the major protocol version. And by using the word "Currently" it has always suggested that new return values could be introduced later, and thus for feature detection you should use >= 3 [1]: https://www.postgresql.org/docs/13/libpq-status.html#LIBPQ-PQPROTOCOLVERSION