How do you batch insert and still obtain identity? - Mailing list pgsql-jdbc

From Robert Nicholson
Subject How do you batch insert and still obtain identity?
Date
Msg-id 847CAC0D-29A7-472F-9DF1-D4B657BAAD75@gmail.com
Whole thread Raw
List pgsql-jdbc
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.

pgsql-jdbc by date:

Previous
From: Tom Lane
Date:
Subject: Re: Compression
Next
From: Ying-Wen Chen
Date:
Subject: callable statement cannot work when call stored procedure @postgres84