pgsql: Dump ALTER TABLE ... ATTACH PARTITION as a separate ArchiveEntry - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Dump ALTER TABLE ... ATTACH PARTITION as a separate ArchiveEntry
Date
Msg-id E1kz97q-0000fa-OS@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Dump ALTER TABLE ... ATTACH PARTITION as a separate ArchiveEntry.

Previously, we emitted the ATTACH PARTITION command as part of
the child table's ArchiveEntry.  This was a poor choice since it
complicates restoring the partition as a standalone table; you have
to ignore the error from the ATTACH, which isn't even an option when
restoring direct-to-database with pg_restore.  (pg_restore will issue
the whole ArchiveEntry as one PQexec, so that any error rolls back
the table creation as well.)  Hence, separate it out as its own
ArchiveEntry, as indeed we already did for index ATTACH PARTITION
commands.

Justin Pryzby

Discussion: https://postgr.es/m/20201023052940.GE9241@telsasoft.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9a4c0e36fbd671b5e7426a5a0670bdd7ba2714a0

Modified Files
--------------
src/bin/pg_dump/common.c       | 39 ++++++++++++++++++++-
src/bin/pg_dump/pg_dump.c      | 77 ++++++++++++++++++++++++++++++------------
src/bin/pg_dump/pg_dump.h      | 10 +++++-
src/bin/pg_dump/pg_dump_sort.c |  7 ++++
4 files changed, 109 insertions(+), 24 deletions(-)


pgsql-committers by date:

Previous
From: Thomas Munro
Date:
Subject: pgsql: Fix function prototypes in dependency.h.
Next
From: Amit Kapila
Date:
Subject: pgsql: Optimize DropRelFileNodeBuffers() for recovery.