Hi all Does anyone know why Form_pg_sequence has a field sequence_name that duplicates the sequence's name from pg_class ?
It's assigned when the sequence is created by copying it from pg_class. It isn't subsequently referenced anywhere as far as I can see. It isn't updated by ALTER SEQUENCE ... RENAME TO, so it isn't necessarily actually the correct sequence name either. It gets written as part of the Form_pg_sequence each time we write a sequence advance to WAL, but just seems to be a waste of space. Am I missing something obvious or should it just be removed? Or perhaps replaced with the sequence's Oid in pg_class, since that'd be quite handy for logical decoding of sequences. If we need to keep it for some reason then it should probably be updated by ALTER SEQUENCE. (Arose out of http://www.postgresql.org/message-id/CAMsr+YHSxwZA-xHsgNLpA_DbTywVQYDX8CUjBZ9Sbr=d7xc...@mail.gmail.com ) -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services