Thread: pg_dump not correctly saving schema with partitioned tables?

pg_dump not correctly saving schema with partitioned tables?

From
chester c young
Date:
have database with many partitions.  each partition table has its own primary key sequence.
  Column  ||                          Modifiers                           
-----------++--------------------------------------------------------------uno_id    || not null default
nextval('cmp0004.cmt_uno_id_seq'::regclass)

when dumped and then resorted, the pk sequence is changed to an inherited- from table:

   Column    ||                      Modifiers                       
--------------++------------------------------------------------------uno_id       || not null default
nextval('uno_uno_id_seq'::regclass)

(another error is that the pk sequence does not spec the schema!)

is there any way I can reliably backup and restore the db?




Re: pg_dump not correctly saving schema with partitioned tables?

From
Tom Lane
Date:
chester c young <chestercyoung@yahoo.com> writes:
> have database with many partitions.  each partition table has its own primary key sequence.
>    Column  ||                          Modifiers                           
> -----------++--------------------------------------------------------------
>  uno_id    || not null default nextval('cmp0004.cmt_uno_id_seq'::regclass)

> when dumped and then resorted, the pk sequence is changed to an inherited- from table:


>     Column    ||                      Modifiers                       
> --------------++------------------------------------------------------
>  uno_id       || not null default nextval('uno_uno_id_seq'::regclass)

> (another error is that the pk sequence does not spec the schema!)

I see no reason to think there is a bug here; it's more likely that you
do not understand the display behavior of regclass constants.  They only
print a schema name if your current search_path is such that the
relation wouldn't be found by writing just the unqualified name.
So the most likely explanation for the discrepancy above is that you
executed the two \d commands under different search_path settings.

It's possible that you have actually found a pg_dump bug, but if so
you'll need to submit a complete test-case exhibiting the bug.
        regards, tom lane