]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Teach pg_upgrade to handle in-place tablespaces.
authorNathan Bossart <nathan@postgresql.org>
Wed, 30 Jul 2025 15:48:41 +0000 (10:48 -0500)
committerNathan Bossart <nathan@postgresql.org>
Wed, 30 Jul 2025 15:48:41 +0000 (10:48 -0500)
commit412036c22d6a605340dbe397da1fb12fccd3897f
tree341c5349ba99099969a7a83c0876b7e8ace27a15
parentce9a6244b5b4ce1df71611512a757353803404a5
Teach pg_upgrade to handle in-place tablespaces.

Presently, pg_upgrade assumes that all non-default tablespaces
don't move to different directories during upgrade.  Unfortunately,
this isn't true for in-place tablespaces, which move to the new
cluster's pg_tblspc directory.  This commit teaches pg_upgrade to
handle in-place tablespaces by retrieving the tablespace
directories for both the old and new clusters.  In turn, we can
relax the prohibition on non-default tablespaces for same-version
upgrades, i.e., if all non-default tablespaces are in-place,
pg_upgrade may proceed.

This change is primarily intended to enable additional pg_upgrade
testing with non-default tablespaces, as is done in
006_transfer_modes.pl.

Reviewed-by: Corey Huinker <corey.huinker@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/aA_uBLYMUs5D66Nb%40nathan
src/bin/pg_upgrade/check.c
src/bin/pg_upgrade/info.c
src/bin/pg_upgrade/parallel.c
src/bin/pg_upgrade/pg_upgrade.h
src/bin/pg_upgrade/relfilenumber.c
src/bin/pg_upgrade/t/006_transfer_modes.pl
src/bin/pg_upgrade/tablespace.c