Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vUlG3-007Gbg-0H for pgsql-hackers@arkaria.postgresql.org; Sun, 14 Dec 2025 12:31:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vUlG0-00Cmgx-2P for pgsql-hackers@arkaria.postgresql.org; Sun, 14 Dec 2025 12:31:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vUlG0-00Cmgj-1D for pgsql-hackers@lists.postgresql.org; Sun, 14 Dec 2025 12:31:25 +0000 Received: from mail-oo1-xc29.google.com ([2607:f8b0:4864:20::c29]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vUlFy-000gdA-23 for pgsql-hackers@lists.postgresql.org; Sun, 14 Dec 2025 12:31:24 +0000 Received: by mail-oo1-xc29.google.com with SMTP id 006d021491bc7-65b3843853bso1684188eaf.2 for ; Sun, 14 Dec 2025 04:31:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765715481; x=1766320281; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=9RDARcPEczeO8XMOlzkuTsIBomyB2noni2ZlO41rCMQ=; b=LdaH8CEplGau+xlg/CuLECUguQwxD1+I7g3dF86w3ses4KLx0wDz3S3d3WDbznzupg 6zfV2Yng/umq6k6JG/UXysftrnr8hqR9NCjYUNColaiXKqM1tH4gSC4mO+Su9+zwUBum QcF6xuGTCBpje99APe2wps5UnVQ9b8od3QlrGpbUYS4DMncc2PiLywCugajJzJnOsGaB M2EavOJnnADnPk9ZnTF9ia/ejKjTpHTHVbk/FvlRjk1JD67yU12Hen4oKdPa6A/SSrFr oNifo9xu4vdUcKQmiUbA+ieS0hH1u9/e7qnWRPH3en0x3D2oQPkQmOHWsKtx3D5Uba/g OQqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765715481; x=1766320281; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=9RDARcPEczeO8XMOlzkuTsIBomyB2noni2ZlO41rCMQ=; b=VbdEKWCoiuJIHK7F7UDpXjzRA93Aw84H6Mv7EvgzyiNZH46Z6xo/TE2Ew6B5Lc1B74 tnGEDnz6j1DZN+eDqigV+txoULOOvIOucB1fN1RT0j9cAbJ1i8XVQpcD2am1IF76M4mF zCeS1IqsC/DalARxshjkunDpufO6cDHfjlQalRDuUkOwZP14xU3XFk6FJGKH+AqkEmei g1ZH0rYPv2u+606g4/arTBPXloN9PEQcvOJJ63BrMsv4SFVTIiunjsEAPrnsnGOZWi3Z p3zjhIagshImLo1s66BFmuhy8egEpauM1S2TnMiV7e7A/+ui0dm5UigDbn0MFxyNFU5r TF3w== X-Forwarded-Encrypted: i=1; AJvYcCVE+rzYEUekAkWEZROOI0Nxrq7ct5rsu9FRJaovrYsNpsSeJ8krVPAG0595DiqX+QIs4vT5wtFfnrcTYlMt@lists.postgresql.org X-Gm-Message-State: AOJu0YwuyQHZ0m1hpL2xa3GXjkcRkWq8y7pqg3aO6NeWGjx/oAUH8lGp 34Ln9Y2YsyoFr41mdx3/0E0m3BQaHGAN5KWusrjv4Ucd1BSAvd6fRHo/ggQ8narU/IQ0LFDaqrF MMEr2ySyibHjDd5FjwEncGH1a9kZTFO8= X-Gm-Gg: AY/fxX6UWtYDyKrOd9fLO//g/4L6/A96cykuSlfFUywR4l61gl2/x7da/34Eo+hs8xE f2MMxUhCorcuVNXAQ224xmLfenmvxAUt7kbmOuw936OmT2lfv7ySozjyVseLhEB0b2GXCbhXIL5 RkxaA5TH6ZUsBt/mLQN2sVqZGfVBbif8eNTsAUQ4fTfFlpybkNnc1BF1E+BHbTrhR98X44ebIr8 9hHSJXvGnqTpwkUr5IeXMfvxVuAp4eOTaUGaZNjdyWH53GuKld51z51s8ByDdt+A/sUnw== X-Google-Smtp-Source: AGHT+IHXMHDmdG8qGNjzR5yGdoSsnWzFwlCgUNWzvMi2NsWbQRDmqwfrkbFfN8MmENGRR+lbUu/4cQctsj4hmKwII08= X-Received: by 2002:a05:6820:818a:b0:659:9a49:9070 with SMTP id 006d021491bc7-65b4526a013mr3264664eaf.59.1765715480663; Sun, 14 Dec 2025 04:31:20 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Dave Cramer Date: Sun, 14 Dec 2025 07:31:05 -0500 X-Gm-Features: AQt7F2pN5ghGRrKPjW2efMdW330RFTKVvSTwLtUvKSYnnrpqR-raKjgBsCFXolg Message-ID: Subject: Re: Proposal to allow setting cursor options on Portals To: Jacob Champion Cc: Jelte Fennema-Nio , PostgreSQL Hackers , Heikki Linnakangas Content-Type: multipart/alternative; boundary="000000000000ffdace0645e8ab76" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000ffdace0645e8ab76 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 11 Dec 2025 at 14:21, Jacob Champion < jacob.champion@enterprisedb.com> wrote: > [I considered splitting this off into a new thread, but I think Dave > has to wait for it to be resolved before much can happen with the > patch. Sorry Dave.] > No worries, I expected discussion. > > On Wed, Dec 10, 2025 at 3:01=E2=80=AFPM Jelte Fennema-Nio > wrote: > > If we keep the features that are bundled with a protocol version bump > > of the kind where a client, either has to do nothing to implement it, > > or at worst has to ignore the contents of a new message/field. Then > > implementing support becomes so trivial for clients that I don't think > > it'd be a hurdle for client authors to implement support for 3.3, 3.4, > > 3.5 and if they only wanted a feature from the 3.6 protocol.^1 I'll > > call these things "no-op implementations" from now on. > > It's too late for that, isn't it? 3.2's only feature doesn't work that > way (and couldn't have been designed that way, as far as I can tell). > So I don't have any confidence that all future features will fall in > line with this new rule. > > NegotiateProtocolVersion is the only in-band tool we have to ratchet > the protocol forward. Why go through all this pain of getting NPV > packets working, only to immediately limit its power to the most > trivial cases? > > > I think we disagree on this. I think the downside of using protocol > > extensions for everything is that we then end up with N*N different > > combinations of features in the wild that servers and clients need to > > deal with. We have to start to define what happens when features > > interact, but either of them is not enabled. > > In the worst case? Yes. (That worst case doesn't really bother me. > Many other protocols regularly navigate extension combinations.) > > But! The two extension proposals in flight at the moment -- GoAway and > cursor options -- are completely orthogonal, no? Both to each other, > and to the functionality in 3.2. There are no combinatorics yet. So it > seems strange to optimize for combinatorics out of the gate, by > burning through a client-mandatory minor version every year. > > > With incrementing > > versions you don't have that problem, > > You still have N*M. Implementers have to test each feature of their > 3.10 client against server versions 3.0-9, rather than testing against > a single server that turns individual extension support on and off. I > prefer the latter (but maybe that's just because it's what I'm used > to). Middleboxes increase the matrix further, as you point out below. > As a client author we test against multiple options all the time. I don't think this should be an argument against changing the protocol, otherwise we will never change it. > > Paradoxically, if all N features happen to be orthogonal, the testing > burden for the extension strategy collapses to... N. > Minor-version-per-year is worse for that case. > I had never contemplated features being dependent on one another, only additive and orthogonal. > > > which results in simpler logic > > in the spec, servers and clients. > > I don't want to dissuade a proof of concept for this, because simpler > logic everywhere sounds amazing. But it sounds like magical thinking > to me. A bit like telling Christoph that the dpkg dependency graph is > too complicated, so it should be a straight line instead -- if that > worked, presumably everyone would have done it that way, right? > Convince me that you're not just ignoring necessary complexity in an > attempt to stamp out unnecessary complexity. > > An example of an established network protocol that follows this same > strategy would be helpful. How do their clients deal with the > minor-version treadmill? > > > Finally, because we don't have any protocol extensions yet. All > > clients still need to build infrastructure for them, including libpq. > > For clients still on 3.0 (the vast majority of them), they'd have to > add infrastructure for sliding minor version ranges, too. > > > So I'd argue that if we make such "no-op implementation" features use > > protocol extensions, then it'd be more work for everyone. > > Why advertise a protocol extension if you plan to ignore it? Don't > advertise it. Do nothing. That's even less work than retrofitting > packet parsers to correctly ignore a byte range when minorversion > X. > > > > Plus I think it's unwise to introduce a 3.3 before we're > > > confident that 3.2 can be widely deployed, and I'm trying to put > > > effort into the latter for 19, so that I'm not just sitting here > > > gatekeeping. > > > > I'm not sure what you mean with this. People use libpq18 and PG18, and > > I've heard no complaints about protocol problems. So I think it was a > > success. Do you mean widely deployed by default? > > Yes. Or even just "deployed". GitHub shows zero hits outside of the > Postgres fork graph. > As mentioned pgjdbc supports 3.2. It was trivial to implement. > > Google's results show that an organization called "cardo" tried > max_protocol_version=3Dlatest. They had to revert it. :( Time for > grease. > > > Why exactly does that > > matter for 3.3? Anything that stands default deployment in the way for > > 3.2, will continue to stand default deployment in the way for 3.3. > > Exactly. Don't you want to make sure that clients in the ecosystem are > able to use this _before_ we rev the version again, and again? We > don't ever get these numbers back. > Well there are 97 of them. 1 per year is a long time. > > Like, I'm arguing as hard as I can against the very existence of the > treadmill. But if I'm outvoted on that, *please* don't start the > treadmill before other people can climb on -- otherwise, they won't be > able to give us any feedback at all! > > > Personally, if we flip the default in e.g. 5 years from now. I'd much > > rather have it be flipped to a very nice 3.6 protocol, than still only > > having the single new feature that was added in 3.2. > > Those are not the only two choices. I'd rather we get a bunch of nice > features without any flipping at all, if that's possible. It looks > possible to me. > > > > IETF has a bunch of related case studies [1,2,3] that might be useful > > > reading, even if we decide that their experience differs heavily from > > > ours. > > > > I gave them a skim and they seem like a good read (which I'll do > > later). But I'm not sure part of them you thought was actionable for > > the discussion about version bumps vs protocol extensions. (I did see > > useful stuff for the grease thread, but that seems better to discuss > > there) > > For this conversation, I'm focused on RFC 8170. Specifically the > concepts of incremental transitions and incentive alignment > (cost/benefit to individual community members). > > I view minor-version-per-year as violating both of those principles. > It instead focuses on the ease of the people who are most plugged into > this mailing list, and who have the most power to change things on a > whim. > > > ^1: You and I only talked about clients above, but obviously there's > > also proxies and other servers that implement the protocol to > > consider. If a feature that is "no-op implementation" on the client is > > a complicated implementation on the proxy/server then maybe a protocol > > extension is indeed the better choice. I think for GoAway it's trivial > > to "no-op implement" too on the proxy/server. For this cursor option > > proposal it's less clear cut imo. Proxies can probably simply forward > > the message to the server, although maybe PgBouncer would want to > > throw an error when a client uses a hold cursor (but it also doesn't > > do that for SQL level hold cursors, so that seems like an optional > > enhancement). > FWIW, HOLDABLE cursors are not the only option this enables. It enables all of the other cursor options. > > I think proposals should attempt to answer those questions as a > prerequisite to commit, personally. Or at least, we should be moving > in that direction, if that's too harsh on the first authors who are > trying to get things moving inside the protocol. > > More generally, it bothers me that we still don't have a clear mental > model of middlebox extensibility. We're just retreading the > discussions from [1] instead of starting from where we stopped, and > that's exhausting for me. > > (As a reminder: 3.2 broke my testing rig, which relied on implicit > assumptions around minor-version extensibility for middleboxes. I > didn't speak up until very late, because it was just a testing rig, > and I could change it. I should have spoken up immediately, because > IIRC, pgpool then broke as well.) > > > Other servers might not even support hold cursors, but > > then they could simply throw a clear error (like pgbouncer would do). > > If throwing an error is an acceptable server implementation, then I > > think a "no-op implementation" is again trivial. > > A server is always free to decide at the _application_ layer that it > will error out for a particular packet that it can parse at the > _network_ layer. But it seems a lot more user-friendly to just decline > the protocol bit, if it's directly tied to an application-level > feature that isn't implemented. I think we should encourage that when > possible; otherwise we've traded protocol fragmentation for > application fragmentation. > Are we concerned with servers that are not compatible with Postgres ? As far as protocol fragmentation goes, I see this more as evolution to a more complete usable implementation. I do see that we will have to be careful with interdependent protocol options. Dave --000000000000ffdace0645e8ab76 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On T= hu, 11 Dec 2025 at 14:21, Jacob Champion <jacob.champion@enterprisedb.com> wrote:
[I considered splitting= this off into a new thread, but I think Dave
has to wait for it to be resolved before much can happen with the
patch. Sorry Dave.]

No worries, I expec= ted discussion.=C2=A0
postgres@jeltef.nl> wrote= :
> If we keep the features that are bundled with a protocol version bump<= br> > of the kind where a client, either has to do nothing to implement it,<= br> > or at worst has to ignore the contents of a new message/field. Then > implementing support becomes so trivial for clients that I don't t= hink
> it'd be a hurdle for client authors to implement support for 3.3, = 3.4,
> 3.5 and if they only wanted a feature from the 3.6 protocol.^1 I'l= l
> call these things "no-op implementations" from now on.

It's too late for that, isn't it? 3.2's only feature doesn'= t work that
way (and couldn't have been designed that way, as far as I can tell). So I don't have any confidence that all future features will fall in line with this new rule.

NegotiateProtocolVersion is the only in-band tool we have to ratchet
the protocol forward. Why go through all this pain of getting NPV
packets working, only to immediately limit its power to the most
trivial cases?

> I think we disagree on this. I think the downside of using protocol > extensions for everything is that we then end up with N*N different > combinations of features in the wild that servers and clients need to<= br> > deal with. We have to start to define what happens when features
> interact, but either of them is not enabled.

In the worst case? Yes. (That worst case doesn't really bother me.
Many other protocols regularly navigate extension combinations.)

But! The two extension proposals in flight at the moment -- GoAway and
cursor options -- are completely orthogonal, no? Both to each other,
and to the functionality in 3.2. There are no combinatorics yet. So it
seems strange to optimize for combinatorics out of the gate, by
burning through a client-mandatory minor version every year.

> With incrementing
> versions you don't have that problem,

You still have N*M. Implementers have to test each feature of their
3.10 client against server versions 3.0-9, rather than testing against
a single server that turns individual extension support on and off. I
prefer the latter (but maybe that's just because it's what I'm = used
to). Middleboxes increase the matrix further, as you point out below.

As a client author we test against multiple= =C2=A0options all the time.=C2=A0 I don't think this should be an argum= ent against changing the protocol, otherwise we will never change it.
=

Paradoxically, if all N features happen to be orthogonal, the testing
burden for the extension strategy collapses to... N.
Minor-version-per-year is worse for that case.

I had never contemplated features being dependent on one another, o= nly additive and orthogonal.=C2=A0=C2=A0

> which results in simpler logic
> in the spec, servers and clients.

I don't want to dissuade a proof of concept for this, because simpler logic everywhere sounds amazing. But it sounds like magical thinking
to me. A bit like telling Christoph that the dpkg dependency graph is
too complicated, so it should be a straight line instead -- if that
worked, presumably everyone would have done it that way, right?
Convince me that you're not just ignoring necessary complexity in an attempt to stamp out unnecessary complexity.

An example of an established network protocol that follows this same
strategy would be helpful. How do their clients deal with the
minor-version treadmill?

> Finally, because we don't have any protocol extensions yet. All > clients still need to build infrastructure for them, including libpq.<= br>
For clients still on 3.0 (the vast majority of them), they'd have to add infrastructure for sliding minor version ranges, too.

> So I'd argue that if we make such "no-op implementation"= features use
> protocol extensions, then it'd be more work for everyone.

Why advertise a protocol extension if you plan to ignore it? Don't
advertise it. Do nothing. That's even less work than retrofitting
packet parsers to correctly ignore a byte range when minorversion > X.
> > Plus I think it's unwise to introduce a 3.3 before we're<= br> > > confident that 3.2 can be widely deployed, and I'm trying to = put
> > effort into the latter for 19, so that I'm not just sitting h= ere
> > gatekeeping.
>
> I'm not sure what you mean with this. People use libpq18 and PG18,= and
> I've heard no complaints about protocol problems. So I think it wa= s a
> success. Do you mean widely deployed by default?

Yes. Or even just "deployed". GitHub shows zero hits outside of t= he
Postgres fork graph.

As mentioned pgjdb= c supports 3.2. It was trivial to implement.=C2=A0

Google's results show that an organization called "cardo" tri= ed
max_protocol_version=3Dlatest. They had to revert it. :( Time for
grease.

> Why exactly does that
> matter for 3.3? Anything that stands default deployment in the way for=
> 3.2, will continue to stand default deployment in the way for 3.3.

Exactly. Don't you want to make sure that clients in the ecosystem are<= br> able to use this _before_ we rev the version again, and again? We
don't ever get these numbers back.

= Well there are 97 of them. 1 per year is a long time.=C2=A0

Like, I'm arguing as hard as I can against the very existence of the treadmill. But if I'm outvoted on that, *please* don't start the treadmill before other people can climb on -- otherwise, they won't be<= br> able to give us any feedback at all!

> Personally, if we flip the default in e.g. 5 years from now. I'd m= uch
> rather have it be flipped to a very nice 3.6 protocol, than still only=
> having the single new feature that was added in 3.2.

Those are not the only two choices. I'd rather we get a bunch of nice features without any flipping at all, if that's possible. It looks
possible to me.

> > IETF has a bunch of related case studies [1,2,3] that might be us= eful
> > reading, even if we decide that their experience differs heavily = from
> > ours.
>
> I gave them a skim and they seem like a good read (which I'll do > later). But I'm not sure part of them you thought was actionable f= or
> the discussion about version bumps vs protocol extensions. (I did see<= br> > useful stuff for the grease thread, but that seems better to discuss > there)

For this conversation, I'm focused on RFC 8170. Specifically the
concepts of incremental transitions and incentive alignment
(cost/benefit to individual community members).

I view minor-version-per-year as violating both of those principles.
It instead focuses on the ease of the people who are most plugged into
this mailing list, and who have the most power to change things on a
whim.

> ^1: You and I only talked about clients above, but obviously there'= ;s
> also proxies and other servers that implement the protocol to
> consider. If a feature that is "no-op implementation" on the= client is
> a complicated implementation on the proxy/server then maybe a protocol=
> extension is indeed the better choice. I think for GoAway it's tri= vial
> to "no-op implement" too on the proxy/server. For this curso= r option
> proposal it's less clear cut imo. Proxies can probably simply forw= ard
> the message to the server, although maybe PgBouncer would want to
> throw an error when a client uses a hold cursor (but it also doesn'= ;t
> do that for SQL level hold cursors, so that seems like an optional
> enhancement).

FWIW, HOLDABLE curso= rs are not the only option this enables. It enables all of the other cursor= options.=C2=A0

I think proposals should attempt to answer those questions as a
prerequisite to commit, personally. Or at least, we should be moving
in that direction, if that's too harsh on the first authors who are
trying to get things moving inside the protocol.

More generally, it bothers me that we still don't have a clear mental model of middlebox extensibility. We're just retreading the
discussions from [1] instead of starting from where we stopped, and
that's exhausting for me.

(As a reminder: 3.2 broke my testing rig, which relied on implicit
assumptions around minor-version extensibility for middleboxes. I
didn't speak up until very late, because it was just a testing rig,
and I could change it. I should have spoken up immediately, because
IIRC, pgpool then broke as well.)

> Other servers might not even support hold cursors, but
> then they could simply throw a clear error (like pgbouncer would do).<= br> > If throwing an error is an acceptable server implementation, then I > think a "no-op implementation" is again trivial.

A server is always free to decide at the _application_ layer that it
will error out for a particular packet that it can parse at the
_network_ layer. But it seems a lot more user-friendly to just decline
the protocol bit, if it's directly tied to an application-level
feature that isn't implemented. I think we should encourage that when possible; otherwise we've traded protocol fragmentation for
application fragmentation.

Are we conce= rned with servers that are not compatible with Postgres ?=C2=A0
A= s far as protocol fragmentation goes, I see this more as evolution to a mor= e complete usable implementation. I do see that we will have to be careful = with interdependent=C2=A0protocol options.=C2=A0

D= ave
--000000000000ffdace0645e8ab76--