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>, Nathan Bossart <nathandbossart@gmail.com>
Date: 2026-02-24T20:29:02Z
Lists: pgsql-hackers

Attachments

On Tue, Feb 24, 2026 at 10:58 AM Jacob Champion
<jacob.champion@enterprisedb.com> wrote:
> We do store (the major version part of) `pg_ctl --version` at some
> point, which we could improve upon, but I agree that adding additional
> complexity here doesn't actually give us any benefit.

Okay, here are the patches I propose. The ones for 18-HEAD check for
PG10 and below, and 14-17 additionally check that libpq >= 18, before
adding max_protocol_version=3.0.

I smoke-tested upgrades from 9.2, 10.1, and 11.0 for all six branches,
and then re-ran that test matrix with pg_upgrade linked against a
greased libpq.

--Jacob

Commits

  1. pg_upgrade: Use max_protocol_version=3.0 for older servers

  2. libpq: Grease the protocol by default

  3. libpq: Prepare for protocol grease during 19beta