| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> | 
|---|---|
| To: | Jeroen van Vianen <jeroen(at)design(dot)nl> | 
| Cc: | Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgreSQL(dot)org | 
| Subject: | Re: [HACKERS] Re: Notation for nextval() (was Re: Several small patches) | 
| Date: | 1999-12-17 06:37:13 | 
| Message-ID: | 7437.945412633@sss.pgh.pa.us | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-hackers | 
Jeroen van Vianen <jeroen(at)design(dot)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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Rahul Ravindrudu | 1999-12-17 08:00:33 | pointer to a table | 
| Previous Message | Tom Lane | 1999-12-17 06:24:43 | Re: [HACKERS] Re: Notation for nextval() (was Re: Several small patches) |