pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Un-break pg_upgrade from pre-v12 servers.
Date: Tue, 07 Jul 2020 22:10:56 +0000
Message-ID: <E1jsvnk-0006d9-OD@gemulon.postgresql.org> (raw)

Un-break pg_upgrade from pre-v12 servers.

I neglected to test this scenario while preparing commit f3faf35f3,
so of course it was broken, thanks to some very obscure and undocumented
code in pg_dump.  Pre-v12 databases might have toast tables attached to
partitioned tables, which we need to ignore since newer servers never
create such useless toast tables.  There was a filter for this case in
binary_upgrade_set_type_oids_by_rel_oid(), which appeared to just
prevent the pg_type OID from being copied.  But actually it managed to
prevent the toast table from being created at all --- or it did before
I took out that logic.  But that was a fundamentally bizarre place to be
making the test in the first place.  The place where the filter should
have been, one would think, is binary_upgrade_set_pg_class_oids(), so
add it there.

While at it, reorganize binary_upgrade_set_pg_class_oids() so that it
doesn't make a completely useless query when it knows it's being
invoked for an index.  And correct a comment that mis-described the
scenario where we need to force creation of a TOAST table.

Per buildfarm.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3f96af4619c8b129ec8d5f4fb961df4310999383

Modified Files
--------------
src/bin/pg_dump/pg_dump.c | 75 +++++++++++++++++++++++++++--------------------
1 file changed, 44 insertions(+), 31 deletions(-)



Message-ID: <E1jsvnk-0006d9-OD@gemulon.postgresql.org>
Permalink:  ../E1jsvnk-0006d9-OD@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1jsvnk-0006d9-OD@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: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Un-break pg_upgrade from pre-v12 servers.
  In-Reply-To: <E1jsvnk-0006d9-OD@gemulon.postgresql.org>
  References: <E1jsvnk-0006d9-OD@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