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 1vuul2-00CfZ2-0b for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Feb 2026 15:55:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vuul0-001kYN-2c for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Feb 2026 15:55:30 +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 1vuul0-001kY9-1D for pgsql-hackers@lists.postgresql.org; Tue, 24 Feb 2026 15:55:30 +0000 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vuuku-000000014lu-3KgY for pgsql-hackers@lists.postgresql.org; Tue, 24 Feb 2026 15:55:29 +0000 Received: by mail-qt1-x842.google.com with SMTP id d75a77b69052e-506cb1b63d0so61021391cf.2 for ; Tue, 24 Feb 2026 07:55:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dunslane-net.20230601.gappssmtp.com; s=20230601; t=1771948523; x=1772553323; darn=lists.postgresql.org; h=in-reply-to:autocrypt:content-language:from:references:cc:to :subject:user-agent:mime-version:date:message-id:from:to:cc:subject :date:message-id:reply-to; bh=d5vLY9wIu2AAoXqk0tvPClVQa7tyq1cH2t+ZCMI5e3o=; b=DEteKIWhB+q2P6kwWUNKw130oY9Y5kNr92e1zwZ0hWN/JCdEDFcb7k0v5bJD2mgK4g qj5MPbfGPZiP0lSzh0rK7gokUS99SmTjQpaBv5M5tF1TUg7loUFLpdp130V5pY6Qbbg5 vZVm67yuJeRuRlRF/Z3ztS2kR8gFmLWuMq8KbvL9kMAGwyUD51g6ydW14S8BDpFVObAJ +KEC+Nw3Rtzc7T+F4Q3KF6y/Rzs3aeRGcRyiZinwuFSyep4PRuS2RMDnAFDHrRn9CEGS SO4qKLSeSJXjWZKA2zuCv6/QGybgxvuhMijI2hcXAMliPi+ewFSj39wQP4HG7fnIICRB C8pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771948523; x=1772553323; h=in-reply-to:autocrypt:content-language:from:references:cc:to :subject:user-agent:mime-version:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=d5vLY9wIu2AAoXqk0tvPClVQa7tyq1cH2t+ZCMI5e3o=; b=TOOelHTbWeRbs+R2yWLUf6bf85WxazecwUv/fQzkbyyrk2lILEsNiuxKdBZVtITdA5 r9XoVZS0MY5AGBYFvrTolB07iIPQyeUFQK9AI4LtUDfQDIvdmjyxi/N/XDoU9zvQaBDk rGL9t5H0sl5CnWRsNVCS+57TwIMQEADX4uoyyiIauddWhhKhy5rhvzzufhI1v51iNkmn OUyWg66/07/fXD4Pk6Qba8lAKVzfpYCZKrwBDiZH1m1wxmFKMRj5FkrI9beMmal9vIQH 0nRsXUXR1jOWAcCPF5xD/zJeU3fXjyt54fQITS9Uwao35eyc4VtWl+iNldQCKTBKsh0I eWSA== X-Forwarded-Encrypted: i=1; AJvYcCUsqsEupbiP7BmYdpQA9Yt9xEzqE0D0COMJTnp91o45P+c17hK6zHfCp6/N6OTTR5G68Cm/SqndBRwubb+q@lists.postgresql.org X-Gm-Message-State: AOJu0Yw6Knku9BDjyZdDZccgdmLUMdNluQJ7+vmdWfiLNqPWsfGSpX4z KFGCaihAS+rUo3egq8EqNVtls8tThE0I3wOVkx4YuFr3nnZ3znkhu/+gdsrUviex+Fk= X-Gm-Gg: AZuq6aJd7WCQm/ZxncyND+f3gtm8aBvL0zAcmyY1c0H1uFQbg42aCsyiTKSI5yi6V/K DbOWNXr56YT9vT1HvO76EVh6gTUg2jdNulzECWV8336I0OFJ80molebHMV+ycCfqoBMVp3JaA4u BntiFch5meJMvGEZFDixCHk3ynv/xlbbbonww3rGB13hrUz/vWlSLfCCGZ05ZatxJA3UpscDDG5 HFgO8xQhldY3OR89gxPBElJLW9WRsHdo5qn6bGz752BC8EG9bjz0drE+1G4y8crQqhtSJyhit4k aRk5x5SBGrMiq5sNgxesa/5veVjF+QSiXZjdClR8DIewHg8AL3gh7WvThrD/w2nF1+DxeWATG6+ kTZrRtz0Oaqfv8qgRVG1AJ/t5AkIsUnpetzGQY9pLXcajA5q3q+7dkMzbiY8WUrOPAOyHxyQzIl 1NcIrmKj9lLqMaqszO+aw3COp8iu3D6A== X-Received: by 2002:a05:622a:20d:b0:4f1:b9ec:f6a4 with SMTP id d75a77b69052e-5070bc11e32mr172860801cf.33.1771948523000; Tue, 24 Feb 2026 07:55:23 -0800 (PST) Received: from ?IPV6:2605:a601:a6b0:500::1cb? ([2605:a601:a6b0:500::1cb]) by smtp.googlemail.com with ESMTPSA id 6a1803df08f44-8997c690f9csm97161846d6.11.2026.02.24.07.55.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 24 Feb 2026 07:55:22 -0800 (PST) Content-Type: multipart/alternative; boundary="------------ooOn89b5bugILcwSLfwtZsH7" Message-ID: Date: Tue, 24 Feb 2026 10:55:20 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: pgsql: libpq: Grease the protocol by default To: Tom Lane , Jacob Champion Cc: Jelte Fennema-Nio , pgsql-hackers@lists.postgresql.org References: <3626145.1771885089@sss.pgh.pa.us> <3635497.1771889682@sss.pgh.pa.us> <3797860.1771893905@sss.pgh.pa.us> <3864574.1771898936@sss.pgh.pa.us> From: Andrew Dunstan Content-Language: en-US Autocrypt: addr=andrew@dunslane.net; keydata= xsBNBE7KWFkBCAClrid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k6e15kln4ZvFBWUg23p93w/pqXcxY6+k/8TEk+C4R+M6w7o2PLGOjdZ +kPiUcw5H85zf/yZJwQXzisXaNduwWB6Vads9YC9dj6kPR1c4VGRqAaYL++LAEOqrlvm2Tvq QqZRtnEAEQEAAcLAfAQYAQgAJgIbDBYhBOQ+WEYd/Hy/RGkVpZn6f8tZ/DuBBQJoGNI2BQkd EODdAAoJEJn6f8tZ/DuBfw0IAKTsfD40teP/pp+bsLLMSxPXUYrrprTj7WFB5v61p6dkpSr/ qXmMlyahdxQFaPmfVgVirB1Vk/kHiWNnnGjfUV9nB2Zg9LI0Xb9/ts3LsUiRWXzG3tkMY6XL vsVOxW4XFRND9l2q+WW93aZ1DZl+fqWfYgMvsusFRhmGFOKTRfKPta2Pkv+AhA24N4+PrR5p bU4k2MO8PAGiK8eaYKGFG1bHKuAvoDoF7WXJ3FHxuWqLnKEt4dfOLm5pAe3zq1Lt6q8azT9i QWGpSAK5vQUWQHBHpiDjdPeqKZ6HiAXIIKfSmb+jrvXBqoP+D6/K7rUjG2aXiRtTIAXms9sm VRu7cmw= In-Reply-To: <3864574.1771898936@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------ooOn89b5bugILcwSLfwtZsH7 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2026-02-23 Mo 9:08 PM, Tom Lane wrote: > Jacob Champion writes: >> On Mon, Feb 23, 2026 at 4:45 PM Tom Lane 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. cheers andrew -- Andrew Dunstan EDB:https://www.enterprisedb.com --------------ooOn89b5bugILcwSLfwtZsH7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit


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.


cheers


andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com
--------------ooOn89b5bugILcwSLfwtZsH7--