Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1buhKf-0006Tx-Mi for pgsql-jdbc@arkaria.postgresql.org; Thu, 13 Oct 2016 14:50:05 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1buhKf-0001Io-9B for pgsql-jdbc@arkaria.postgresql.org; Thu, 13 Oct 2016 14:50:05 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1buhKB-0000jj-90 for pgsql-jdbc@postgresql.org; Thu, 13 Oct 2016 14:49:35 +0000 Received: from mx1.redhat.com ([209.132.183.28]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1buhK8-0004v0-UD for pgsql-jdbc@postgresql.org; Thu, 13 Oct 2016 14:49:34 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 560524E330 for ; Thu, 13 Oct 2016 14:49:31 +0000 (UTC) Received: from [10.36.116.74] (ovpn-116-74.ams2.redhat.com [10.36.116.74]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9DEnTMl007795 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 13 Oct 2016 10:49:30 -0400 Subject: Re: Return Codes of BatchUpdateException in PostgreSql 9.6 To: pgsql-jdbc@postgresql.org References: <614642043.9384313.1476347124138.ref@mail.yahoo.com> <614642043.9384313.1476347124138@mail.yahoo.com> <1476361957.3513.1.camel@gmail.com> <1148283253.9934888.1476365049022@mail.yahoo.com> From: Jeremy Whiting Message-ID: <690688e2-6a85-bbe9-c8f4-0c221256747f@redhat.com> Date: Thu, 13 Oct 2016 15:49:28 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <1148283253.9934888.1476365049022@mail.yahoo.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 13 Oct 2016 14:49:31 +0000 (UTC) X-Pg-Spam-Score: -7.3 (-------) 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 Hi, Can you check what is returned by the back end for 9.5 and 9.6. You will need to set logLevel=2 That will help to narrow down the problem. Jeremy On 13/10/16 14:24, Tillmann Schulz wrote: > 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