Обсуждение: pg_upgrade: can I use same binary for old & new?

Поиск
Список
Период
Сортировка

pg_upgrade: can I use same binary for old & new?

От
Pierre Fortin
Дата:
Hi,

[Hope this gets through after dumping DKIM-ignorant mail provider.]

Wanting to upgrade from:
PostgreSQL 15.13 on x86_64-mageia-linux-gnu, 
compiled by gcc (Mageia 15.1.0-1.mga10) 15.1.0, 64-bit
to:
PG 17.5 

Way back, I was able to use -k|--link option on pg_upgrade (PG13 to PG15);
but since then:

- my DB has grown to over 8TB
- even with ~70TB, I don't have enough contiguous disk space to
  dump/restore
- my Linux distro (Mageia) is not setup to handle multiple versions of
  postgres (installing 17.5 removes 15.13). Worse, it failed to install
  part of the module when it saw /var/lib/pgsql/data still there:
  https://bugs.mageia.org/show_bug.cgi?id=34306

I've glanced at the pg_upgrade source code (my C skills are ancient) and
it appears pg_upgrade is virtually the same from 15.13 to 17.5.

My question:  did I miss anything, or would:
$ pg_upgrade -d data15 -D data17 -k
suffice?

Besides not noticing significant difference between the two versions, the
docs at https://www.postgresql.org/docs/current/pgupgrade.html 
contain: "default is the directory where pg_upgrade resides" 

If new pg_upgrade is the only binary, will both -b and -B default to it?
Maybe at minimum I may need to specify:
$ pg_upgrade -b /usr/bin -d data15 -D data17 -k
?

Thanks,
Pierre








Re: pg_upgrade: can I use same binary for old & new?

От
"David G. Johnston"
Дата:
On Sat, Jul 5, 2025 at 9:52 AM Pierre Fortin <pf@pfortin.com> wrote:
If new pg_upgrade is the only binary, will both -b and -B default to it?
Maybe at minimum I may need to specify:
$ pg_upgrade -b /usr/bin -d data15 -D data17 -k


 pgsql/pgsql-18/bin
> ./pg_ctl -D /var/pgsql/postgres-17 start
waiting for server to start....2025-07-05 16:58:56.559 UTC [293839] FATAL:  database files are incompatible with server
2025-07-05 16:58:56.559 UTC [293839] DETAIL:  The data directory was initialized by PostgreSQL version 17, which is not compatible with this version 18beta1.
pg_ctl: control file appears to be corrupt


David J.