Re: [HACKERS] Bug in pg_dump --table and --exclude-table for declarative partition table handling. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Bug in pg_dump --table and --exclude-table for declarative partition table handling.
Date
Msg-id 31399.1494507762@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] Bug in pg_dump --table and --exclude-table fordeclarative partition table handling.  (Jeevan Ladhe <jeevan.ladhe@enterprisedb.com>)
Responses Re: [HACKERS] Bug in pg_dump --table and --exclude-table fordeclarative partition table handling.
List pgsql-hackers
Jeevan Ladhe <jeevan.ladhe@enterprisedb.com> writes:
> On Thu, May 11, 2017 at 4:47 PM, Ashutosh Bapat <
>> We add PARTITION OF clause for a table which is partition, so if the
>> parent is not present while restoring, the restore is going to fail.

> +1
> But, similarly for inheritance if we dump a child table, it's dump is
> broken as
> of today. When we dump a child table we append "inherits(parenttab)" clause
> at
> the end of the DDL. Later when we try to restore this table on a database
> not
> having the parenttab, the restore fails.
> So, I consider this as a bug.

It sounds exactly what I'd expect.  In particular, given that pg_dump has
worked that way for inherited tables from the beginning, it's hard to see
any must-fix bugs here.

You could argue that it would be better for pg_dump to emit something
like
CREATE TABLE c (...);ALTER TABLE c INHERIT p;

so that if p isn't around, at least c gets created.  And I think it
*would* be better, probably.  But if that isn't a new feature then
I don't know what is.  And partitioning really ought to track the
behavior of inheritance here.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: [HACKERS] Time based lag tracking for logical replication
Next
From: Petr Jelinek
Date:
Subject: Re: [HACKERS] Time based lag tracking for logical replication