Re: pgsql: libpq: Grease the protocol by default
Jacob Champion <jacob.champion@enterprisedb.com>
From: Jacob Champion <jacob.champion@enterprisedb.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Jelte Fennema-Nio <postgres@jeltef.nl>,
pgsql-hackers@lists.postgresql.org, Andrew Dunstan <andrew@dunslane.net>
Date: 2026-02-24T17:18:19Z
Lists: pgsql-hackers
Attachments
- 0001-pg_upgrade-Use-max_protocol_version-3.0-for-older-se.14.patch (application/octet-stream) patch 0001
On Mon, Feb 23, 2026 at 6:08 PM Tom Lane <tgl@sss.pgh.pa.us> 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". Ha, right. Luckily the failure is very loud when testing :) > 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. Attached is a sample backport for REL_14_STABLE, using that strategy. Tested with pg_upgrade 9.2-to-14, when linked against both 14.22 and HEAD versions of libpq. I still need to run a sanity check with the other 9.x lines to make sure I've selected the right cutoffs. > 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. Nice, thanks! --Jacob
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