Re: pg_dump, ATTACH, and independently restorable child partitions

2021-08-30 Thread Justin Pryzby
On Wed, Nov 25, 2020 at 06:35:19PM -0500, Tom Lane wrote: > What we'd need to do if we want this to work with direct-to-DB restore > > > is to split off the ATTACH P

Re: pg_dump, ATTACH, and independently restorable child partitions

2021-01-11 Thread Tom Lane
Justin Pryzby 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 OWNE

Re: pg_dump, ATTACH, and independently restorable child partitions

2020-12-04 Thread Justin Pryzby
On Fri, Dec 04, 2020 at 12:13:05PM -0500, Tom Lane wrote: > Justin Pryzby writes: > > [ v4-0001-pg_dump-output-separate-object-for-ALTER-TABLE.AT.patch ] > > The cfbot is being picky about this: > > 3218pg_dump.c: In function ‘dumpTableAttach’: > 3219pg_dump.c:15600:42: error: suggest parenthese

Re: pg_dump, ATTACH, and independently restorable child partitions

2020-12-04 Thread Tom Lane
Justin Pryzby writes: > [ v4-0001-pg_dump-output-separate-object-for-ALTER-TABLE.AT.patch ] The cfbot is being picky about this: 3218pg_dump.c: In function ‘dumpTableAttach’: 3219pg_dump.c:15600:42: error: suggest parentheses around comparison in operand of ‘&’ [-Werror=parentheses] 3220 if (a

Re: pg_dump, ATTACH, and independently restorable child partitions

2020-12-02 Thread Justin Pryzby
On Wed, Nov 25, 2020 at 06:35:19PM -0500, Tom Lane wrote: > Justin Pryzby writes: > > 1. Maybe pg_restore ExecuteSqlCommandBuf() should (always?) call > > ExecuteSimpleCommands() instead of ExecuteSqlCommand(). It doesn't seem to > > break anything (although that surprised me). > > That certainl

Re: pg_dump, ATTACH, and independently restorable child partitions

2020-11-25 Thread Tom Lane
Justin Pryzby writes: > 1. Maybe pg_restore ExecuteSqlCommandBuf() should (always?) call > ExecuteSimpleCommands() instead of ExecuteSqlCommand(). It doesn't seem to > break anything (although that surprised me). That certainly does break everything, which I imagine is the reason why the cfbot s

Re: pg_dump, ATTACH, and independently restorable child partitions

2020-11-20 Thread Justin Pryzby
On Fri, Nov 06, 2020 at 11:18:35PM -0300, Alvaro Herrera wrote: > On 2020-Oct-24, Justin Pryzby wrote: > > > On Fri, Oct 23, 2020 at 12:29:40AM -0500, Justin Pryzby wrote: > > > > Now that I look, it seems like this is calling PQexec(), which sends a > > > single, > > > "simple" libpq message wi

Re: pg_dump, ATTACH, and independently restorable child partitions

2020-11-06 Thread Alvaro Herrera
On 2020-Oct-24, Justin Pryzby wrote: > On Fri, Oct 23, 2020 at 12:29:40AM -0500, Justin Pryzby wrote: > > Now that I look, it seems like this is calling PQexec(), which sends a > > single, > > "simple" libpq message with: > > |CREATE TABLE ..; ALTER TABLE .. ATTACH PARTITION; > > ..which is tran

Re: pg_dump, ATTACH, and independently restorable child partitions

2020-10-29 Thread Justin Pryzby
On Sat, Oct 24, 2020 at 02:59:49PM -0500, Justin Pryzby wrote: > On Fri, Oct 23, 2020 at 12:29:40AM -0500, Justin Pryzby wrote: > > Since this commit, pg_dump CREATEs tables and then ATTACHes them: > > > > |commit 33a53130a89447e171a8268ae0b221bb48af6468 > > |Author: Alvaro Herrera > > |Date: M

Re: pg_dump, ATTACH, and independently restorable child partitions

2020-10-24 Thread Justin Pryzby
On Fri, Oct 23, 2020 at 12:29:40AM -0500, Justin Pryzby wrote: > Since this commit, pg_dump CREATEs tables and then ATTACHes them: > > |commit 33a53130a89447e171a8268ae0b221bb48af6468 > |Author: Alvaro Herrera > |Date: Mon Jun 10 18:56:23 2019 -0400 > | > |Make pg_dump emit ATTACH PARTITION

pg_dump, ATTACH, and independently restorable child partitions

2020-10-22 Thread Justin Pryzby
Since this commit, pg_dump CREATEs tables and then ATTACHes them: |commit 33a53130a89447e171a8268ae0b221bb48af6468 |Author: Alvaro Herrera |Date: Mon Jun 10 18:56:23 2019 -0400 | |Make pg_dump emit ATTACH PARTITION instead of PARTITION OF (reprise) |... |This change also has the advanta