postgresql/src/bin/pg_upgrade
Jacob Champion a38ed212ff pg_upgrade: Use max_protocol_version=3.0 for older servers
The grease patch in 4966bd3ed found its first problem: prior to the
February 2018 patch releases, no server knew how to negotiate protocol
versions, so pg_upgrade needs to take that into account when speaking to
those older servers.

This will be true even after the grease feature is reverted; we don't
need anyone to trip over this again in the future. Backpatch so that all
supported versions of pg_upgrade can gracefully handle an update to the
default protocol version. (This is needed for any distributions that
link older binaries against newer libpqs, such as Debian.) Branches
prior to 18 need an additional version check, for the existence of
max_protocol_version.

Per buildfarm member crake.

Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/CAOYmi%2B%3D4QhCjssfNEoZVK8LPtWxnfkwT5p-PAeoxtG9gpNjqOQ%40mail.gmail.com
Backpatch-through: 14
2026-02-24 14:01:51 -08:00
..
po Translation updates 2026-02-08 15:11:02 +01:00
t Restrict psql meta-commands in plain-text dumps. 2025-08-11 09:00:00 -05:00
.gitignore Re-add locally-generated files in pg_upgrade's .gitignore and Makefile 2022-06-15 15:36:16 +09:00
check.c pg_upgrade: Make format strings consistent 2025-08-08 00:27:14 +02:00
controldata.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
dump.c pg_upgrade: Use max_protocol_version=3.0 for older servers 2026-02-24 14:01:51 -08:00
exec.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
file.c Introduce PG_IO_ALIGN_SIZE and align all I/O buffers. 2023-04-08 16:34:50 +12:00
function.c Remove useless casts to (void *) in arguments of some system functions 2023-02-07 06:57:59 +01:00
IMPLEMENTATION pg_upgrade: Preserve database OIDs. 2022-01-24 14:23:43 -05:00
info.c Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
Makefile pg_upgrade: copy locale and encoding information to new cluster. 2023-03-09 08:28:05 -08:00
meson.build pg_upgrade: copy locale and encoding information to new cluster. 2023-03-09 08:28:05 -08:00
nls.mk Break up long GETTEXT_FILES lists 2023-03-08 15:05:43 +01:00
option.c Fix copy-and-pasto in error message 2023-05-05 07:50:08 +02:00
parallel.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
pg_upgrade.c Fix unintentional 'NULL' string literal in pg_upgrade. 2025-04-06 09:14:42 -07:00
pg_upgrade.h pg_upgrade: Use max_protocol_version=3.0 for older servers 2026-02-24 14:01:51 -08:00
relfilenumber.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
server.c pg_upgrade: Use max_protocol_version=3.0 for older servers 2026-02-24 14:01:51 -08:00
tablespace.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
TESTING Create common infrastructure for cross-version upgrade testing. 2023-01-16 20:35:55 -05:00
util.c Try to fix pg_upgrade test on Windows, again. 2023-02-01 14:40:25 +13:00
version.c pg_upgrade: Use max_protocol_version=3.0 for older servers 2026-02-24 14:01:51 -08:00