public inbox for [email protected]  
help / color / mirror / Atom feed
From: Andrew Dunstan <[email protected]>
To: Tom Lane <[email protected]>
To: Jacob Champion <[email protected]>
Cc: Jelte Fennema-Nio <[email protected]>
Cc: [email protected]
Subject: Re: pgsql: libpq: Grease the protocol by default
Date: Tue, 24 Feb 2026 17:49:32 -0500
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<CAOYmi+=4QhCjssfNEoZVK8LPtWxnfkwT5p-PAeoxtG9gpNjqOQ@mail.gmail.com>
	<[email protected]>
	<CAOYmi+k8ENYkErqSEYEqW39YWPfe_ii7g5Acm1c9asNuRMriNg@mail.gmail.com>
	<[email protected]>
	<CAOYmi+mtFBsB2zePSvbpa-2Zb-+V5bov_t2BzkGH7vfKX0ny_w@mail.gmail.com>
	<[email protected]>
	<CAOYmi+kC3AN0QJKT0OunHCmi4UU7-15eu7w-DY5ckOgHiQE1QA@mail.gmail.com>
	<[email protected]>
	<[email protected]>


On 2026-02-24 Tu 10:55 AM, Andrew Dunstan wrote:
>
>
> On 2026-02-23 Mo 9:08 PM, Tom Lane wrote:
>> Jacob Champion<[email protected]> writes:
>>> On Mon, Feb 23, 2026 at 4:45 PM Tom Lane<[email protected]> 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


Attachments:

  [text/x-patch] maxprotocolversion.patch (970B, 2-maxprotocolversion.patch)
  download | inline diff:
diff --git a/PGBuild/Modules/TestUpgradeXversion.pm b/PGBuild/Modules/TestUpgradeXversion.pm
index a5e6be5..8e8d262 100644
--- a/PGBuild/Modules/TestUpgradeXversion.pm
+++ b/PGBuild/Modules/TestUpgradeXversion.pm
@@ -513,6 +513,9 @@ sub test_upgrade    ## no critic (Subroutines::ProhibitManyArgs)
 
 	# use the NEW pg_dumpall so we're comparing apples with apples.
 	setinstenv($self, "$installdir", $save_env);
+	local $ENV{PGMAXPROTOCOLVERSION} =
+	  ($oversion le 'REL9_2_STABLE') ? "3.0" : "latest";
+
 	system( qq{"$installdir/bin/pg_dumpall" $dump_opts -p $sport -f }
 		  . qq{"$upgrade_loc/origin-$oversion.sql" }
 		  . qq{> "$upgrade_loc/$oversion-dump1.log" 2>&1});
@@ -575,6 +578,8 @@ sub test_upgrade    ## no critic (Subroutines::ProhibitManyArgs)
 		  . qq{--new-bindir="$installdir/bin" }
 		  . qq{>> "$upgrade_loc/$oversion-upgrade.log" 2>&1});
 
+	delete $ENV{PGMAXPROTOCOLVERSION};
+
 	foreach my $upgradelog (
 		glob(
 			"$installdir/pg_upgrade*


view thread (27+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: pgsql: libpq: Grease the protocol by default
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox