pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: electrotype <electrotype@gmail.com>
To: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: JDBC driver - is "getGeneratedKeys()" guaranteed to return the ids in the same order a batch insert was made?
Date: Fri, 11 Dec 2020 09:36:51 -0500
Message-ID: <abb4c189-57f5-9d35-13ac-64976349b41b@gmail.com> (raw)
In-Reply-To: <CAKFQuwZesZPEmnycdcwCYMGWJ=TVXqc=OhrwyopSKGfe=c+KSA@mail.gmail.com>
References: <36689061-0844-2dfd-a4ee-8006d8a15ca9@gmail.com>
	<CADK3HHL68fd+D_e-jGdx9J--hrwEx26-5a-V6fFf=OOLUTgApw@mail.gmail.com>
	<1d0c8b21-25cc-2a3e-7f25-81f2de645f1e@gmail.com>
	<CADK3HH+h60g5dmZq4qhESo1Q1yn-x4EGixYZbOGufc=tHFu-1A@mail.gmail.com>
	<4ce0f5f5-d608-887b-b5ef-21ae187e3b58@gmail.com>
	<CAKFQuwZQV8eguy50d5kJ5r4MKduaJk4mWmFG5tsnZ11-ov=n-g@mail.gmail.com>
	<c41792c8-7a94-2736-0316-dba3d1e7c885@gmail.com>
	<CAKFQuwZesZPEmnycdcwCYMGWJ=TVXqc=OhrwyopSKGfe=c+KSA@mail.gmail.com>

My take is that there is presently no guarantee, and that with current efforts to add parallelism it 
is quite probable that observation of such non-orderedness is simply a matter of time. With batching 
it seems best to combine its use with single inserts in order to avoid this problem.
>
> David J.
>
I wish that was not the conclusion, but at least it is clear!

Thanks for the help to both of you.

view thread (11+ messages)

Message-ID: <abb4c189-57f5-9d35-13ac-64976349b41b@gmail.com>
Permalink:  ../abb4c189-57f5-9d35-13ac-64976349b41b@gmail.com/
Also on:    postgresql.org/message-id/abb4c189-57f5-9d35-13ac-64976349b41b@gmail.com

 · 

reply

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-general@postgresql.org
  Cc: electrotype@gmail.com
  Subject: Re: JDBC driver - is "getGeneratedKeys()" guaranteed to return the ids in the same order a batch insert was made?
  In-Reply-To: <abb4c189-57f5-9d35-13ac-64976349b41b@gmail.com>
  References: <36689061-0844-2dfd-a4ee-8006d8a15ca9@gmail.com> <CADK3HHL68fd+D_e-jGdx9J--hrwEx26-5a-V6fFf=OOLUTgApw@mail.gmail.com> <1d0c8b21-25cc-2a3e-7f25-81f2de645f1e@gmail.com> <CADK3HH+h60g5dmZq4qhESo1Q1yn-x4EGixYZbOGufc=tHFu-1A@mail.gmail.com> <4ce0f5f5-d608-887b-b5ef-21ae187e3b58@gmail.com> <CAKFQuwZQV8eguy50d5kJ5r4MKduaJk4mWmFG5tsnZ11-ov=n-g@mail.gmail.com> <c41792c8-7a94-2736-0316-dba3d1e7c885@gmail.com> <CAKFQuwZesZPEmnycdcwCYMGWJ=TVXqc=OhrwyopSKGfe=c+KSA@mail.gmail.com> <abb4c189-57f5-9d35-13ac-64976349b41b@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