Re: [HACKERS] Re: Notation for nextval() (was Re: Several small patches) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Re: Notation for nextval() (was Re: Several small patches)
Date
Msg-id 7437.945412633@sss.pgh.pa.us
Whole thread Raw
In response to Re: Notation for nextval() (was Re: Several small patches)  (Jeroen van Vianen <jeroen@design.nl>)
List pgsql-hackers
Jeroen van Vianen <jeroen@design.nl> writes:
>> What I was hoping for was something that would *first* determine whether
>> foo is a sequence and *then* do the transformation only if so.

> I thought about this, but couldn't figure out how to test for foo being a 
> sequence.

IIRC, foo is a sequence if it has relkind 'S'.  You can check the
relkind by looking into the struct returned by heap_open.  The main
thing that needs to be thought about is how to ensure that the sequence
object won't be added to the query's rangetable list if it is used in
a way that looks like a table reference.  It may be that hacking up
ParseFuncOrColumn will be enough to prevent that, or it may not...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Re: Notation for nextval() (was Re: Several small patches)
Next
From: Rahul Ravindrudu
Date:
Subject: pointer to a table