Re: BUG #2512: pg_dump produces unrestorable output when table and serial sequence are not in the same schema - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #2512: pg_dump produces unrestorable output when table and serial sequence are not in the same schema
Date
Msg-id 26258.1152044265@sss.pgh.pa.us
Whole thread Raw
In response to BUG #2512: pg_dump produces unrestorable output when table and serial sequence are not in the same schema  ("Phil Frost" <indigo@bitglue.com>)
List pgsql-bugs
"Phil Frost" <indigo@bitglue.com> writes:
> Creating the database:

> test=> create schema private;
> test=> create table o(i serial primary key);
> test=> alter sequence o_i_seq set schema private;

I would argue that the bug is we allow you to do the above ;-).
It's not really sane to move a serial sequence out of its owning table's
schema (compare the situation for indexes).  If you play with it you'll
find that "alter table o set schema private" will move the sequence too
... but the above case isn't checked for.

This ties into the long-running discussion on whether a serial column
should be entirely a black box or not.  Currently there are quite a few
things you could do to the underlying sequence object that pg_dump would
fail to dump/restore correctly.  One school of thought says we'd be best
off to forbid any direct manipulation of the sequence object.

            regards, tom lane

pgsql-bugs by date:

Previous
From: "tommaso gastaldi"
Date:
Subject: BUG #2513: What? OleDbSchemaGuids not supported ?!!! This is CRUCIAL!
Next
From: Tomasz Ostrowski
Date:
Subject: Re: query very slow when enable_seqscan=on