Unused(?) field Form_pg_sequence.sequence_name, not updated by seq rename

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Unused(?) field Form_pg_sequence.sequence_name, not updated by seq rename
Date: 2015-12-15 04:40:04
Message-ID: CAMsr+YHH2kNLBCm+pBxCbft1S4+Z4mmSHsp7WnpD4xiRQCdqiA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

(Arose out of
http://www.postgresql.org/message-id/CAMsr+YHSxwZA-xHsgNLpA_DbTywVQYDX8CUjBZ9Sbr=d7XcJgQ@mail.gmail.com
)

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

Responses

Browse pgsql-hackers by date

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