Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1knl9j-0003Vs-FA for pgsql-general@arkaria.postgresql.org; Fri, 11 Dec 2020 16:20:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1knl9i-0002uY-E3 for pgsql-general@arkaria.postgresql.org; Fri, 11 Dec 2020 16:20:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1knjXY-0008BE-0G for pgsql-general@lists.postgresql.org; Fri, 11 Dec 2020 14:37:00 +0000 Received: from mail-qk1-x730.google.com ([2607:f8b0:4864:20::730]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1knjXV-0007OA-NS for pgsql-general@lists.postgresql.org; Fri, 11 Dec 2020 14:36:59 +0000 Received: by mail-qk1-x730.google.com with SMTP id w79so8561824qkb.5 for ; Fri, 11 Dec 2020 06:36:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=oifG0tIuRbqMGZKzO+xEpP0t5ntBG2kvTsaTG1H5+MI=; b=ePB/+RneaSYJBPOuDf7UDWykQaWqSLF34e8092pjA95yBK4QlmpQ+AvvO91RB7ZVtE V8j4mHq/7vuCMPxHd/7C/RW5E5wcjzRtCX6RJOOVkRUH/7gMnYb81D23qruimaimqJfn YkFGsILsWDRZz0UmDvdzFUxBfXEtERi8QHJHPNH2r0hKtdepDNwvPN3x7tvDPE1XZuUs 6YXb2Jt3gYlNlhwEcMSjpCY1VUdg/0QyAHd0wlKX944KF3CCJE8arNv4wGbG7/gUqEgl 8oL4bgXwENXImPCK0upmHP+NPwWQU9tv6ujxZPQf4bh+/MQrsMJP4voAJIptozhBHFOE DS1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=oifG0tIuRbqMGZKzO+xEpP0t5ntBG2kvTsaTG1H5+MI=; b=VTlKBvWbYc5A4eYy3axPWtTvcBubmUzIHeFsHuMP2/TJHO0u9E3vy8BflZIYKRSgZh ivuBYY459UI1XlbEt2d/1ZYRU99xJYDIzefFxiatHlOybaUbNyQ1+Q1rABqgwg9otbal ki9MJw+i5MrL1KabAJbodZX/hFSuRaiDU0faMe79vtqZwrmrBqdERTCwJ+MGj/LMSM8v BRI49T0v+8cF8s1B50pUE/X/QVWN3CwdrsH1yzpIEO4/5S4+ZMXLqhEu6vhuuCbPAYt5 UuwREBhVoKEQWaGByOBLW+wGAHpWT0I06xhKLzOXtbDSJOazM/VrXyHchj9lCEeBOF11 TJIQ== X-Gm-Message-State: AOAM530udvpvauOyVx3jme4eD3epKiLm3+BEo94v3Wfsta7wm2Xa+2no BD54A82VAA1nWlK9Ur5O7ck7ke9q/Ps= X-Google-Smtp-Source: ABdhPJxmPXSGYoOm8QhKP6Ze27pIJ69jWIYBbDaTRg1g2v0aboeWnT1loQDCMNIUeKTTXBKWDdKArw== X-Received: by 2002:a37:bac7:: with SMTP id k190mr16495452qkf.464.1607697414731; Fri, 11 Dec 2020 06:36:54 -0800 (PST) Received: from [192.168.50.211] ([104.163.190.166]) by smtp.gmail.com with ESMTPSA id x13sm4040018qtf.89.2020.12.11.06.36.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Dec 2020 06:36:52 -0800 (PST) Subject: Re: JDBC driver - is "getGeneratedKeys()" guaranteed to return the ids in the same order a batch insert was made? To: "pgsql-generallists.postgresql.org" References: <36689061-0844-2dfd-a4ee-8006d8a15ca9@gmail.com> <1d0c8b21-25cc-2a3e-7f25-81f2de645f1e@gmail.com> <4ce0f5f5-d608-887b-b5ef-21ae187e3b58@gmail.com> From: electrotype Message-ID: Date: Fri, 11 Dec 2020 09:36:51 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------6B989D426AC862D55EE5B499" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------6B989D426AC862D55EE5B499 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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. --------------6B989D426AC862D55EE5B499 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit 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.

--------------6B989D426AC862D55EE5B499--