From: Tom Lane <tgl@sss.pgh.pa.us>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: David Rowley <drowley@postgresql.org>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: pg_dump, ATTACH, and independently restorable child partitions
Date: Mon, 11 Jan 2021 21:28:18 -0500
Message-ID: <1094034.1610418498@sss.pgh.pa.us> (raw)
In-Reply-To: <20201204180231.GD24052@telsasoft.com>
References: <20201024195949.GL9241@telsasoft.com>
<20201107021835.GA13348@alvherre.pgsql>
<20201120152055.GF24784@telsasoft.com>
<577158.1606347319@sss.pgh.pa.us>
<20201202225013.GJ24052@telsasoft.com>
<2168110.1607101985@sss.pgh.pa.us>
<20201204180231.GD24052@telsasoft.com>
Justin Pryzby <pryzby@telsasoft.com> writes:
> [ v5-0001-pg_dump-output-separate-object-for-ALTER-TABLE.AT.patch ]
Pushed with mostly cosmetic edits.
One thing I changed that isn't cosmetic is that I set the ArchiveEntry's
owner to be the owner of the child table. Although we aren't going to
do any sort of ALTER OWNER on this, it's still important that the owner
be marked as someone who has the right permissions to issue the ALTER.
The default case is that the original user will issue the ATTACH, which
basically only works if you run the restore as superuser. It looks to
me like you copied this decision from the INDEX ATTACH code, which is
just as broken --- I'm going to go fix/backpatch that momentarily.
Another thing that bothers me still is that it's not real clear that
this code plays nicely with selective dumps, because it's not doing
anything to set the dobj.dump field in a non-default way (which in
turn means that the dobj.dump test in dumpTableAttach can never fire).
It seems like it might be possible to emit a TABLE ATTACH object
even though one or both of the referenced tables didn't get dumped.
In some desultory testing I couldn't get that to actually happen, but
maybe I just didn't push on it in the right way. I'd be happier about
this if we set the flags with something along the lines of
attachinfo->dobj.dump = attachinfo->parentTbl->dobj.dump &
attachinfo->partitionTbl->dobj.dump;
regards, tom lane
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 using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, pryzby@telsasoft.com, alvherre@alvh.no-ip.org, drowley@postgresql.org, pgsql-hackers@lists.postgresql.org
Subject: Re: pg_dump, ATTACH, and independently restorable child partitions
In-Reply-To: <1094034.1610418498@sss.pgh.pa.us>
* 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