Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 7FC3E2E0055 for ; Wed, 20 Feb 2008 05:44:42 -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 88070-08 for ; Wed, 20 Feb 2008 05:44:39 -0400 (AST) Received: from relay1-v.mail.gandi.net (relay1-v.mail.gandi.net [217.70.178.75]) by postgresql.org (Postfix) with ESMTP id CD23A2E003E for ; Wed, 20 Feb 2008 05:44:39 -0400 (AST) Received: from localhost (front3-v.mgt.gandi.net [10.0.10.73]) by relay1-v.mail.gandi.net (Postfix) with ESMTP id DD813362AA for ; Wed, 20 Feb 2008 10:44:37 +0100 (CET) MIME-Version: 1.0 X-Mailer: Gandi Mail Message-ID: <38245.1203500677@motionsponsor.com> To: Reply-To: Content-Type: text/plain; charset="utf-8" X-Origin: 88.183.28.27 Date: Wed, 20 Feb 2008 10:44:37 +0100 Subject: Retrieving last InsertedID : INSERT... RETURNING safe ? From: Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/153 X-Sequence-Number: 18360 Hello everyone,=20 This is my very first POST in this list. I am just starting to work with po= stgresql and the jdbc driver and so far so good ! Only one exception is regarding the best method to retrieve the last insert= ed id (serial). There are many posts on this topic but i couldn t find a de= finitive response.=20 I am using postgresql version 8.2.6 and jdbc 8.2_p505, i ve been experienc= ing INSERT statement with RETURNING myID, using an executeQuery it works gr= eat, i retrieve the proper value everytime at least from the few tests i h= ave been doin locally. Is it THAT easy or could this method break somehow in a live environement ?= If yes could you advise on another method ? Thanks in advance Sebastien.