Re: pg_sequence catalog - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pg_sequence catalog
Date
Msg-id 26112.1473129320@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_sequence catalog  (Andres Freund <andres@anarazel.de>)
Responses Re: pg_sequence catalog
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On September 5, 2016 7:26:42 AM PDT, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> The main problem I can see with this is that serial columns will have
>> default expressions that are written out as
>> "nextval('foo_f1_seq'::regclass)".  I do not think we can afford to
>> break dumps containing that, but I'm not sure how to get the regclass
>> cast replaced with a regsequence cast.

> Why not just continue having a pgclass entry, but no relfilenode?

Yeah, maybe.  I was hoping to dispense with the pg_attribute rows, but
maybe that's not enough overhead to worry about.

In this viewpoint, we'd keep the sequence-specific data in a pg_sequence
catalog.  pg_sequence rows would be extensions of the associated pg_class
rows in much the same way that pg_index rows extend the pg_class entries
for indexes.  We should supply a view pg_sequences that performs the
implied join, and encourage users to select from that rather than directly
from pg_sequence (compare pg_indexes view).
        regards, tom lane



pgsql-hackers by date:

Previous
From: Mithun Cy
Date:
Subject: Re: Patch: Implement failover on libpq connect level.
Next
From: Amit Kapila
Date:
Subject: Re: Speed up Clog Access by increasing CLOG buffers