From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Rod Chamberlin <rod(at)querix(dot)com>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: [HACKERS] Enhancing PGSQL to be compatible with Informix SQL |
Date: | 2000-01-06 16:11:32 |
Message-ID: | 200001061611.LAA13385@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
> However, if you need to know what value is being given to the
> inserted tuple, much the cleanest solution is to select nextval
> before inserting:
>
> SELECT nextval('sequenceobject');
> INSERT INTO table VALUES(... , value-you-just-got, ...);
>
> If you are always going to do that, then a trigger is a waste of cycles.
He can do:
INSERT INTO table VALUES(... , nextval('sequenceobject'), ...);
and currval() will get him the previous nextval() value.
--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From | Date | Subject | |
---|---|---|---|
Next Message | Oleg Broytmann | 2000-01-06 16:20:35 | Re: [HACKERS] New Search Engine ... UdmSearch |
Previous Message | Bruce Momjian | 2000-01-06 16:08:43 | Re: [HACKERS] Enhancing PGSQL to be compatible with Informix SQL |