colin.knox@offers.com writes:
> Basically, pg_get_serial_sequence does not actually check the default value
> in the table, it only checks the most recent sequence to have declared
> itself owned by that column, regardless of what sequence is actually in use.
Quite, and that's its documented behavior:
pg_get_serial_sequence returns the name of the sequence associated with a
column ... This association can be modified or removed with ALTER SEQUENCE
OWNED BY. (The function probably should have been called
pg_get_owned_sequence; its current name reflects the fact that it's
typically used with serial or bigserial columns.)
regards, tom lane