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: Dump ALTER TABLE ... ATTACH PARTITION as a separate ArchiveEntry
Date: Tue, 12 Jan 2021 02:09:38 +0000
Message-ID: <E1kz97q-0000fa-OS@gemulon.postgresql.org> (raw)

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(-)



Message-ID: <E1kz97q-0000fa-OS@gemulon.postgresql.org>
Permalink:  ../E1kz97q-0000fa-OS@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1kz97q-0000fa-OS@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: Dump ALTER TABLE ... ATTACH PARTITION as a separate ArchiveEntry
  In-Reply-To: <E1kz97q-0000fa-OS@gemulon.postgresql.org>
  References: <E1kz97q-0000fa-OS@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