Re: Global Sequences - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Global Sequences
Date
Msg-id 27264.1350573348@sss.pgh.pa.us
Whole thread Raw
In response to Re: Global Sequences  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Global Sequences  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Tue, Oct 16, 2012 at 1:29 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Or maybe better, invent a level of indirection like a "sequence access
>> method" (comparable to index access methods) that provides a compatible
>> set of substitute functions for sequence operations.  If you want to
>> override nextval() for a sequence, don't you likely also need to
>> override setval(), currval(), etc?  Not to mention overriding ALTER
>> SEQUENCE's behavior.

> This might be better, but it's also possibly more mechanism than we
> truly need here.  But then again, if we're going to end up with more
> than a handful of handlers, we probably do want to do this.

It's definitely a lot of mechanism, and if we can get away with
something simpler that's fine with me.  But I'd want to see a pretty
bulletproof argument why overriding *only* nextval is sufficient
(and always will be) before accepting a hook for just nextval.  If we
build an equivalent amount of functionality piecemeal it's going to
be a lot uglier than if we recognize we need this type of concept
up front.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Bug in -c CLI option of pg_dump/pg_restore
Next
From: Christopher Browne
Date:
Subject: Re: [RFC][PATCH] wal decoding, attempt #2 - Design Documents (really attached)