Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bufzr-0002v2-7Z for pgsql-jdbc@arkaria.postgresql.org; Thu, 13 Oct 2016 13:24:31 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bufzq-0005CF-Qf for pgsql-jdbc@arkaria.postgresql.org; Thu, 13 Oct 2016 13:24:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bufzq-0005C9-BD for pgsql-jdbc@postgresql.org; Thu, 13 Oct 2016 13:24:30 +0000 Received: from nm18-vm9.bullet.mail.ir2.yahoo.com ([212.82.96.233]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bufzm-0004wk-W1 for pgsql-jdbc@postgresql.org; Thu, 13 Oct 2016 13:24:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s2048; t=1476365064; bh=zF2SOcQWGndtVA9JwSzxXaSjbXlmUFGPS48QOiY1dN4=; h=Date:From:Reply-To:To:In-Reply-To:References:Subject:From:Subject; b=jPvm1wta+1yrcqLSHijLg3yfQds5c8nj15b3QnPQzClpztKDWsgyd4eYgp60GOU6TfYxLJ+rO87IIYEikedv+cfpDhTP1PxZKTVnTeoCkMoFT2AYD6mmM3Xa/WSM4dd5uiYXHpkzwr49Dta3/vOl0OmR6v57LfkoSP1tlbB2upPnoRAqaBzQ6Ni7lF4VR+lNazTgN3IfYukmzA/UVIp+gcJCEKbuXR+TrN2W80DutmeKaAFqDEDjcusyH0I890i6TkXDy09CBzj9+rQ7qqxgkwkHG706TNo0fTK+JsrCAITZDQ3wlSfXxBsHdzaOspXPN0hMrgr/eaJOwulwa744ow== Received: from [212.82.98.51] by nm18.bullet.mail.ir2.yahoo.com with NNFMP; 13 Oct 2016 13:24:24 -0000 Received: from [212.82.98.64] by tm4.bullet.mail.ir2.yahoo.com with NNFMP; 13 Oct 2016 13:24:24 -0000 Received: from [127.0.0.1] by omp1001.mail.ir2.yahoo.com with NNFMP; 13 Oct 2016 13:24:24 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 208919.99276.bm@omp1001.mail.ir2.yahoo.com X-YMail-OSG: ITUVcbQVM1nO_mdsBKskDsBys_dQVvzk87PCqySBD5qjvO9mPVPekIdt8tt6FRa tW2U5VqB4QQ1kEjiNU6p.3hGKJ2wMT_x9s4BFklyvQUJLeJkl.qLuiTDdxJOJx5QhKQVdmY4TMTz mnL7BJGrFO3euzkSefHumb_G0rnz0u0Vmn6rpZRG8rhlSpPLJkwvLuDihaTuoq1GLBXZzrTpgZga nIho3cIduloud_TwT2TopijVe_gEkmYvAgOmXP0OVFgWMbY7r664mOGZxOJWkAu5QZhm1WApZ1t8 _jvoZIaRFhc5TAjhQee4obX1F6GxP1BmWo7N.8IAxC2.2IEQ41WxAdDw4tNPMN_7cQ.LM1UQZb3r 2B8ppSBkgW0kmdni3WcZ5LyHAYLuprhLMHs4_rT0RRMe6r_VPrhVgQ0ySqfOAid9qZLx7pd6P0gS _j6mQvK6xM9ij1TWzbi3qswKDxfnQ8p2V9I1MXnJhBXi2Z.1CUgpssdE_0GDkv363jCItDvR5jqq 4zrFumNAUijQdWLS168E- Received: from jws700057.mail.ir2.yahoo.com by sendmailws169.mail.ir2.yahoo.com; Thu, 13 Oct 2016 13:24:22 +0000; 1476365062.995 Date: Thu, 13 Oct 2016 13:24:08 +0000 (UTC) From: Tillmann Schulz Reply-To: Tillmann Schulz To: rob stone , "pgsql-jdbc@postgresql.org" Message-ID: <1148283253.9934888.1476365049022@mail.yahoo.com> In-Reply-To: <1476361957.3513.1.camel@gmail.com> References: <614642043.9384313.1476347124138.ref@mail.yahoo.com> <614642043.9384313.1476347124138@mail.yahoo.com> <1476361957.3513.1.camel@gmail.com> Subject: Re: Return Codes of BatchUpdateException in PostgreSql 9.6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Length: 1278 X-Pg-Spam-Score: -2.2 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org The docu says: If the driver continues processing after a failure (and this is the case in my example), BatchUpdateException.getUpdateCounts will have an element for every command. In my case there is an element for every command but all elements contain -3 (Statement.Execute_Failed) in postgres 9.6. I think only the failed statmements should been marked with -3! This behaviour is new in 9.6 and seems to be a bug. Thanks Tillmann >According to the doco, getUpdateCounts():- > >Returns: > an array of int containing the update counts for the updates that >were executed successfully before this error occurred. Or, if the >driver continues to process commands after an error, one of the >following for every command in the batch: > > 1. an update count > 2. Statement.SUCCESS_NO_INFO to indicate that the command executed >successfully but the number of rows affected is unknown > 3. Statement.EXECUTE_FAILED to indicate that the command failed to >execute successfully > > >I do not know if the Postgres "driver continues to process commands >after an error" but if it does then the array should contain 10 entries >and one would have the "Statement.EXECUTE_FAILED". > >Tomorrow, I'll dig a bit deeper if nobody else can explain this. > >HTH, >Rob -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc