Re: pgsql: libpq: Grease the protocol by default
Andrew Dunstan <andrew@dunslane.net>
From: Andrew Dunstan <andrew@dunslane.net>
To: Tom Lane <tgl@sss.pgh.pa.us>,
Jacob Champion <jacob.champion@enterprisedb.com>
Cc: Jelte Fennema-Nio <postgres@jeltef.nl>, pgsql-hackers@lists.postgresql.org
Date: 2026-02-24T22:49:32Z
Lists: pgsql-hackers
Attachments
- maxprotocolversion.patch (text/x-patch) patch
On 2026-02-24 Tu 10:55 AM, Andrew Dunstan wrote: > > > On 2026-02-23 Mo 9:08 PM, Tom Lane wrote: >> Jacob Champion<jacob.champion@enterprisedb.com> writes: >>> On Mon, Feb 23, 2026 at 4:45 PM Tom Lane<tgl@sss.pgh.pa.us> wrote: >>>> Also: I was initially baffled why you thought this needs >>>> back-patching, but I guess you have one eye on packagers like >>>> Debian who think they can make older versions use newer libpq.so. >>> Right. >> Actually, that is going to be harder than you thought, because libpq >> before v18 will spit up on connection option "max_protocol_version". >> This patch will not work as-is for back-patching unless we care to >> also back-patch the addition of that option, which I'd be inclined >> to resist. >> >> Fortunately, we long ago had the foresight to invent PQlibVersion, >> so you could make addition of the extra option conditional on >> PQlibVersion(conn) >= 180000 in branches before 18. >> >>> Hmmm, looks like the -dump1.log output is actually from *before* >>> pg_upgrade actually runs: >> Yeah, I came to the same conclusion. I got a clean BF run using >> your patch together with the attached patch for the BF client. >> (In this patch, I did not worry about scenarios involving old >> minor releases. If Andrew is excited about that case he can >> extend the version-comparison logic.) >> >> > > > I am not worried about old minor releases. I am currently testing a > patch with similar intent to yours. > > Here's what worked for me, even before Jacob's patch of 15 minutes or so ago. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com
Commits
-
pg_upgrade: Use max_protocol_version=3.0 for older servers
- c47744ede01c 14.23 landed
- e726620d208e 15.18 landed
- a38ed212ff23 16.14 landed
- ad7fc3f1f83f 17.10 landed
- 1b2773179f31 18.4 landed
- a60a103386a1 19 (unreleased) landed
-
libpq: Grease the protocol by default
- 4966bd3ed95e 19 (unreleased) cited
-
libpq: Prepare for protocol grease during 19beta
- d8d7c5dc8f74 19 (unreleased) cited