pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Preserve relfilenode of pg_largeobject and its index across pg_u
Date: Fri, 08 Jul 2022 14:40:56 +0000
Message-ID: <E1o9pA7-001oEp-8a@gemulon.postgresql.org> (raw)

Preserve relfilenode of pg_largeobject and its index across pg_upgrade.

Commit 9a974cbcba005256a19991203583a94b4f9a21a9 did this for user
tables, but pg_upgrade treats pg_largeobject as a user table, and so
needs the same treatment. Without this fix, if you rewrite the
pg_largeobject table and then perform an upgrade with pg_upgrade, the
table will apparently be empty on the new cluster, while all of your
objects will end up with an orphaned file.

With this fix, instead of the old cluster's pg_largeobject files ending
up orphaned, the original files fro the new cluster do. That's mostly
harmless because we expect the table to be empty, but we might want
to arrange to remove the as part of the upgrade. Since we're still
debating the best way of doing that, I (rhaas) have decided to postpone
dealing with that problem and get the basic fix committed.

Justin Pryzby, reviewed by Shruthi Gowda and by me.

Discussion: http://postgr.es/m/20220701231413.GI13040@telsasoft.com

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/a2996478c32d27171a786f59eff0505b1722b9ea

Modified Files
--------------
src/bin/pg_dump/pg_dump.c              | 37 ++++++++++++++++++++--------------
src/bin/pg_upgrade/t/002_pg_upgrade.pl |  2 ++
2 files changed, 24 insertions(+), 15 deletions(-)



view thread (2+ messages)

Message-ID: <E1o9pA7-001oEp-8a@gemulon.postgresql.org>
Permalink:  ../E1o9pA7-001oEp-8a@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1o9pA7-001oEp-8a@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: rhaas@postgresql.org
  Subject: Re: pgsql: Preserve relfilenode of pg_largeobject and its index across pg_u
  In-Reply-To: <E1o9pA7-001oEp-8a@gemulon.postgresql.org>
  References: <E1o9pA7-001oEp-8a@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