Re: mysql's last_insert_id

From: Dennis Gearon <gearond(at)fireserve(dot)net>
To: Dennis Björklund <db(at)zigo(dot)dhs(dot)org>
Cc: Bo Lorentsen <bl(at)netgroup(dot)dk>, Martijn van Oosterhout <kleptog(at)svana(dot)org>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: mysql's last_insert_id
Date: 2003-08-29 13:56:56
Message-ID: 3F4F5BA8.7070404@fireserve.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-08-29 14:09:15 Re: PostgreSQL upgrade -> fails to start server
Previous Message Jason Godden 2003-08-29 13:51:16 PostgreSQL on Slashdot