pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathan@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Teach pg_upgrade to handle in-place tablespaces.
Date: Wed, 30 Jul 2025 15:49:17 +0000
Message-ID: <E1uh93N-001VoZ-0V@gemulon.postgresql.org> (raw)

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/412036c22d6a605340dbe397da1fb12fccd3897f

Modified Files
--------------
src/bin/pg_upgrade/check.c                 | 20 ++++-----
src/bin/pg_upgrade/info.c                  | 38 +++++++++++++++--
src/bin/pg_upgrade/parallel.c              | 11 +++--
src/bin/pg_upgrade/pg_upgrade.h            |  8 ++--
src/bin/pg_upgrade/relfilenumber.c         | 57 ++++++++++++--------------
src/bin/pg_upgrade/t/006_transfer_modes.pl | 35 ++++++++++++++--
src/bin/pg_upgrade/tablespace.c            | 65 ++++++++++++++++++++++++------
7 files changed, 164 insertions(+), 70 deletions(-)



Message-ID: <E1uh93N-001VoZ-0V@gemulon.postgresql.org>
Permalink:  ../E1uh93N-001VoZ-0V@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1uh93N-001VoZ-0V@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: nathan@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Teach pg_upgrade to handle in-place tablespaces.
  In-Reply-To: <E1uh93N-001VoZ-0V@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox