From: Robert Nicholson <robert.nicholson@gmail.com>
To: pgsql-jdbc@postgresql.org
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> (raw)
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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: robert.nicholson@gmail.com
Subject: Re: How do you batch insert and still obtain identity?
In-Reply-To: <847CAC0D-29A7-472F-9DF1-D4B657BAAD75@gmail.com>
References: <847CAC0D-29A7-472F-9DF1-D4B657BAAD75@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox