Обсуждение: pgsql: Dump ALTER TABLE ... ATTACH PARTITION as a separate ArchiveEntry

Поиск
Список
Период
Сортировка

pgsql: Dump ALTER TABLE ... ATTACH PARTITION as a separate ArchiveEntry

От
Tom Lane
Дата:
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(-)