Re: pgsql: libpq: Grease the protocol by default

From: Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Andrew Dunstan <andrew(at)dunslane(dot)net>
Subject: Re: pgsql: libpq: Grease the protocol by default
Date: 2026-02-24 17:18:19
Message-ID: CAOYmi+=96EGcQnY2w99yLeARHsbvgT_2Bv1hjXKUziykMzMhtA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Mon, Feb 23, 2026 at 6:08 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com> writes:
> > On Mon, Feb 23, 2026 at 4:45 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

Attachment Content-Type Size
0001-pg_upgrade-Use-max_protocol_version-3.0-for-older-se.14.patch application/octet-stream 5.1 KB

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Jacob Champion 2026-02-24 17:27:52 Re: pgsql: libpq: Grease the protocol by default
Previous Message Álvaro Herrera 2026-02-24 16:41:40 pgsql: Add backtrace support for Windows using DbgHelp API

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2026-02-24 17:19:50 Re: Make use of unvolatize() in vac_truncate_clog()
Previous Message Zsolt Parragi 2026-02-24 17:13:09 Re: [PATCH] Simplify ExecWithoutOverlapsNotEmpty by removing unused parameter