Currently serial is dumped as a sequence and appropriate default
statement.
With my upcoming dependency patch serials depend on the appropriate
column. Drop the column (or table) and the sequence goes with it.
The depencency information does not survive the pg_dump / restore
process however as it's recreated as the table and individual
sequence.
I see 2 options for carrying the information.
Store sequence information in the SERIAL creation statement:
CREATE TABLE tab (col1 SERIAL(<start num>, <sequence name>));
Or store the dependency information in the sequence:
CREATE SEQUENCE ... REQUIRES COLUMN <column>;
The former makes a lot more sense, and it's nice that the sequence
information is in one place.
--
Rod