I see an obvious problem in the way pg_dump dumps serials. At the moment,
we have length 64 identifiers. If someone has a 64 character table name
and adds a serial to it, it will get a truncated sequence name, with _seq
o the end.
pg_dump will dump it like this:
CREATE TABLE really_long_name (
a SERIAL UNIQUE
);
SELECT SETVAL('really_long_na_seq', 120);
However, if we up 7.4, say, to use 128 character identifiers, then this
restore will fail, as the sequence name will NOT be truncated and the
setval() call will fail.
We really need:
ALTER SEQUENCE ON really_long_name(a) ....
Chris