Skip site navigation (1) Skip section navigation (2)

Re: Retrieving last InsertedID : INSERT... RETURNING safe ?

From: Dave Cramer <davec(at)fastcrypt(dot)com>
To: Guillaume Cottenceau <gc(at)mnc(dot)ch>
Cc: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>, <spastor(at)motionsponsor(dot)com>, <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Retrieving last InsertedID : INSERT... RETURNING safe ?
Date: 2008-02-20 11:53:30
Message-ID: 0C2798BB-F7F0-4B4B-92E9-358D78D1CDE4@fastcrypt.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
> Well, that other solution is dangerous in case multiple inserts
> to that table are done concurrently; a quite common usage pattern
> with java web applications handling multiple HTTP requests with
> concurrent java threads..
>
No it is not dangerous. It is the right way to do it. There is  
absolutely no danger in using currval in this manner.

Dave

In response to

Responses

pgsql-jdbc by date

Next:From: Dave CramerDate: 2008-02-20 11:54:20
Subject: Re: Retrieving last InsertedID : INSERT... RETURNING safe ?
Previous:From: Guillaume CottenceauDate: 2008-02-20 11:37:44
Subject: Re: Retrieving last InsertedID : INSERT... RETURNING safe ?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group