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.