Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 921819F9B59 for ; Tue, 18 Sep 2007 12:45:56 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 87081-03-7 for ; Tue, 18 Sep 2007 12:45:51 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from www.goldencode.com (smtp.goldencode.com [72.17.138.114]) by postgresql.org (Postfix) with ESMTP id A0D3C9F9867 for ; Tue, 18 Sep 2007 12:45:51 -0300 (ADT) Received: from emlsrv01.internal.goldencode.com (unknown [192.168.1.51]) by www.goldencode.com (Postfix) with SMTP id 1CE9F1C15F for ; Tue, 18 Sep 2007 10:47:15 -0400 (EDT) Received: from [192.168.1.103] (ecf.internal.goldencode.com [192.168.1.103]) by emlsrv01.internal.goldencode.com (Hethmon Brothers Smtpd) id 20070918113551-39699-7 ; Tue, 18 Sep 2007 11:35:51 -0500 Message-ID: <46EFF277.1090309@goldencode.com> Date: Tue, 18 Sep 2007 11:44:55 -0400 From: Eric Faulhaber Reply-To: ecf@goldencode.com Organization: Golden Code Development User-Agent: Thunderbird 1.5.0.13 (X11/20070824) MIME-Version: 1.0 To: Kris Jurka CC: pgsql-jdbc@postgresql.org Subject: Re: Batch INSERT failing with error 22P02 References: <46EEE4EF.80608@goldencode.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/91 X-Sequence-Number: 17513 Kris Jurka wrote: > > > On Mon, 17 Sep 2007, Eric Faulhaber wrote: > >> I recently upgraded from PG 8.1.8 to 8.2.4. I made a corresponding >> move in JDBC driver versions from postgresql-8.1-408.jdbc3.jar to >> postgresql-8.2-506.jdbc4.jar (binary distributions in both cases). >> During a lengthy import using Hibernate (yes, I realize it's not the >> most efficient mechanism for bulk import), I hit the following error: >> >> SEVERE: ERROR: invalid input syntax for type oid: "" >> >> Caused by: java.sql.BatchUpdateException: Batch entry 0 insert into >> turnaround (turn_number, site, item, purchase_order_number, >> purchase_order_line, lot, serial_number, quantity_issued, >> expiration_date, id) values (0000XBJG, GSO, 0A0001H9L, 427190, 15, , >> , -14000.00000, NULL, 59657893) was aborted. Call getNextException >> to see the cause. >> SEVERE: An SQLException was provoked by the following failure: >> java.lang.IllegalArgumentException: Can't change resolved type for >> param: 7 from 1043 to 26 >> .... > > We've seen this report once before, but weren't able to get to the > bottom of it because it also occurred on a large dataset. > > http://archives.postgresql.org/pgsql-jdbc/2007-06/threads.php#00041 Yes, before posting I googled the error message and found part of this discussion, as well as the resulting change to the error message in SimpleParameterList.java. > > In his case int4 and int8 were getting mixed up which is a little more > understandable, in your case it's confusing varchar and oid which > seems less likely. Any idea what component is mixing up these types? As I understand it from setting a breakpoint at the point the exception is thrown and tracking back through the stack, the OID type (26) is reported by the back-end and is compared with the type the driver expects for the given parameter. But then I wonder why we would not see this error with the same back-end and the older JDBC driver... > Is there any chance you can run this with the URL parameter > loglevel=2, which will produce tons of logging information, or can you > make this test case available to me? OK, I generated the debug log file (>1.4GB). How do I get this to you? Even the relevant portions alone are probably too long to inline in a message to the list. > > Kris Jurka > > Thanks, Eric Faulhaber