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