Andrew Sullivan <[EMAIL PROTECTED]> writes:
> On Fri, Feb 02, 2007 at 01:38:40PM -0600, Demel, Jeff wrote:
>>>> SCOPE_IDENTITY() method is going to work or not.

>>> I doubt it.  What does it do?
>> 
>> It returns the id of the record just inserted.

> Ah.  Well, there's no in-principle notion if "id" in Postgres (OIDs
> are optional as of several versions ago).  But if you have a primary
> key that's an integer you populate using a sequence, then you can use
> the currval() function to get the value of the sequence.

Also, as of 8.2 INSERT RETURNING is a good way to collect the value
of an auto-generated key field (or any other auto-generated field...)

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

                http://www.postgresql.org/about/donate

Reply via email to