"Phil Frost" <indigo(at)bitglue(dot)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