Re: mysql's last_insert_id - Mailing list pgsql-general

From Dennis Gearon
Subject Re: mysql's last_insert_id
Date
Msg-id 3F4F5BA8.7070404@fireserve.net
Whole thread Raw
In response to Re: mysql's last_insert_id  (Dennis Björklund <db@zigo.dhs.org>)
List pgsql-general
Dennis Björklund wrote:

>It's not needed. The following works fine (if the tables exists of course)
>and has no problems with concurrency:
>
>INSERT INTO foo(id,x) VALUES (DEFAULT, 'value');
>INSERT INTO bar(id,foo_ref) VALUES (DEFAULT, currval('foo_id_seq'));
>
>
>
You don't even need the 'DEFAULT' word as I remember, but it makes for
easier code to follow.


pgsql-general by date:

Previous
From: Jason Godden
Date:
Subject: PostgreSQL on Slashdot
Next
From: Tom Lane
Date:
Subject: Re: PostgreSQL upgrade -> fails to start server