Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id D7E9F2E004C for ; Wed, 20 Feb 2008 08:01:58 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 29410-06-2 for ; Wed, 20 Feb 2008 08:01:55 -0400 (AST) Received: from mail.mnc.ch (62-2-77-205.static.cablecom.ch [62.2.77.205]) by postgresql.org (Postfix) with ESMTP id 9D3A62E007A for ; Wed, 20 Feb 2008 08:01:48 -0400 (AST) Received: from localhost (mail2.mnc.ch [127.0.0.1]) by mail.mnc.ch (Postfix) with ESMTP id 06E1B2307A; Wed, 20 Feb 2008 12:01:47 +0000 (GMT) X-Virus-Scanned: amavisd-new at mnc.ch Received: from mail.mnc.ch ([127.0.0.1]) by localhost (mail2.mnc.ch [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id 2RsdZI8VQFpt; Wed, 20 Feb 2008 12:01:46 +0000 (GMT) Received: from meuh.localdomain (62-2-77-204.static.cablecom.ch [62.2.77.204]) by mail.mnc.ch (Postfix) with ESMTP id 74D8223079; Wed, 20 Feb 2008 12:01:46 +0000 (GMT) Received: by meuh.localdomain (Postfix, from userid 1000) id 3F120183709; Wed, 20 Feb 2008 13:01:44 +0100 (CET) To: Dave Cramer Cc: "Heikki Linnakangas" , , Subject: Re: Retrieving last InsertedID : INSERT... RETURNING safe ? References: <38245.1203500677@motionsponsor.com> <47BC0AF6.2060500@enterprisedb.com> <87prurrh87.fsf@mnc.ch> <0C2798BB-F7F0-4B4B-92E9-358D78D1CDE4@fastcrypt.com> From: Guillaume Cottenceau X-Hashcash: 1:20:080220:davec@fastcrypt.com::qkluobAk8G6GomdU:00000000000000000000000000000000000000000001vY X-Hashcash: 1:20:080220:heikki@enterprisedb.com::YcjUDpge8x5LtefT:000000000000000000000000000000000000000uQf X-Hashcash: 1:20:080220:spastor@motionsponsor.com::DxAZlH6TRXz6W6vX:000000000000000000000000000000000000DA1r X-Hashcash: 1:20:080220:pgsql-jdbc@postgresql.org::QsG/d++2HEdgJXoy:0000000000000000000000000000000000002OdK Date: Wed, 20 Feb 2008 13:01:44 +0100 In-Reply-To: <0C2798BB-F7F0-4B4B-92E9-358D78D1CDE4@fastcrypt.com> (Dave Cramer's message of "Wed\, 20 Feb 2008 06\:53\:30 -0500") Message-ID: <87ir0jrg47.fsf@mnc.ch> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/159 X-Sequence-Number: 18366 Dave Cramer writes: >> 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. Doh! Sorry for the noise. I should have double checked, especially because Heikki is really not the kind of guy to talk bullshit :/ -- Guillaume Cottenceau