Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id C8C18633703 for ; Sat, 3 Oct 2009 18:36:26 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 96237-02 for ; Sat, 3 Oct 2009 21:36:19 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.24]) by mail.postgresql.org (Postfix) with ESMTP id 52C2C632A95 for ; Sat, 3 Oct 2009 18:36:19 -0300 (ADT) Received: by qw-out-2122.google.com with SMTP id 9so622073qwb.61 for ; Sat, 03 Oct 2009 14:36:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:content-type :content-transfer-encoding:subject:date:message-id:to:mime-version :x-mailer; bh=DTHE1gds6x0/M/gUky+i+waCKD1wouTiQ2UXpM1zCiM=; b=f7v6ZToZdOG4/FXHcQClK3RbQ0mSF/db2/HFI9ZKCan6NzbMUwtN2b1hzh5a5rn3yb DeTX6bXNvF/i6rsdVKWyavpzz3UFl/leEzRn5d9PcuIpvblJfZGzlX17ML+3PhD4pWIE caHRP2ksbT5AGyCgvCCctOzxYfSw8C7KqCpOY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:content-type:content-transfer-encoding:subject:date:message-id :to:mime-version:x-mailer; b=RZv0T5NPdjM+fet//A5pvf8MQSLm0+2OOWi6LLYFEOzI15QwJBtsw6fZUOMOZz7CLr UTl9WIK+JrsmaUqSKWcHTzSa5kUIPQXoK0nFS/Sk0iHgU6uML50P+0ZEvNGWOn3iAIfU u67NA0bA4NhGOVsKoS1/HFv7d/BPcXRM4AGo0= Received: by 10.224.81.204 with SMTP id y12mr2104345qak.358.1254605329429; Sat, 03 Oct 2009 14:28:49 -0700 (PDT) Received: from ?10.0.1.5? ([66.102.121.53]) by mx.google.com with ESMTPS id 21sm665945qyk.12.2009.10.03.14.28.48 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 03 Oct 2009 14:28:48 -0700 (PDT) From: Robert Nicholson Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Subject: How do you batch insert and still obtain identity? Date: Sat, 3 Oct 2009 16:28:46 -0500 Message-Id: <847CAC0D-29A7-472F-9DF1-D4B657BAAD75@gmail.com> To: pgsql-jdbc@postgresql.org Mime-Version: 1.0 (Apple Message framework v1076) X-Mailer: Apple Mail (2.1076) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200910/4 X-Sequence-Number: 20006 So, when you make use of Serial, or Autoincrement fields how is it possible to insert in a batch update and then learn the identity of the rows you should inserted? Is it my understanding that when you want to do bulk inserts thru batch update that you are required to provide the primary keys having called a sequence or obtained them before hand since there's no way int he result of an update to obtain the identity of the rows you've just inserted. It is puzzling to me that JDBC doesn't allow you to do this given that it can tell you which statement (by index) succeeded or failed.