Unused(?) field Form_pg_sequence.sequence_name, not updated by seq rename - Mailing list pgsql-hackers

From Craig Ringer
Subject Unused(?) field Form_pg_sequence.sequence_name, not updated by seq rename
Date
Msg-id CAMsr+YHH2kNLBCm+pBxCbft1S4+Z4mmSHsp7WnpD4xiRQCdqiA@mail.gmail.com
Whole thread Raw
Responses Re: Unused(?) field Form_pg_sequence.sequence_name, not updated by seq rename  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Unused(?) field Form_pg_sequence.sequence_name, not updated by seq rename  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-hackers
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.


--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Re: Reusing abbreviated keys during second pass of ordered [set] aggregates
Next
From: Tom Lane
Date:
Subject: Re: Unused(?) field Form_pg_sequence.sequence_name, not updated by seq rename