Skip site navigation (1) Skip section navigation (2)

Re: Batch INSERT failing with error 22P02

From: Kris Jurka <books(at)ejurka(dot)com>
To: Eric Faulhaber <ecf(at)goldencode(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Batch INSERT failing with error 22P02
Date: 2007-09-20 17:35:02
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc

On Thu, 20 Sep 2007, Eric Faulhaber wrote:

> What in the log file is indicating the use of an unspecified type to you? 
> I'd like to investigate this further.

Whenever you see a DescribeStatement message that means the parameters 
you've supplied for that row have at least one unresolved type.

21:29:08.469 (3)  FE=> Describe(statement=S_19)

The normal describe message is for describing a portal, meaning just the 
resultset info while a statement describe will return information on what 
parameter types the server side statement expects.

> Many thanks for a deep look into the log file and for a detailed description 
> of what is going on.  Your analysis has given me some great insight which has 
> led to a possible solution (see below).  Nevertheless, I'd still be 
> interested to find out what triggered this change in behavior from version to 
> version given my use case.

OK, I've got two approaches to figure out what's going on:

1) More type logging information.  This tries to figure our why we're 
sending DescribeStatement and shows all the type info that goes into that 
decision.  It also logs the results of DescribeStatement and when there is 
a conflict the error now contains all the type info from before and after 
the conflict.

2) Where's the unspecified type coming from?  I've put in a hack to the 
driver to throw an exception when the first unspecified type is set which 
should hopefully provide enough information to track it back to your 
application.  Unspecified types are perfectly legal, so this isn't a real 
problem, but it may be informational.

I've put up jar files and associated patches here:

For the unspecified type, the stacktrace alone should be fine.  For the 
logging information, please rerun with loglevel=2 and upload just the last 
10k lines of the file.

Kris Jurka

In response to


pgsql-jdbc by date

Next:From: Eric FaulhaberDate: 2007-09-20 18:49:24
Subject: Re: Batch INSERT failing with error 22P02
Previous:From: Eric FaulhaberDate: 2007-09-20 16:11:40
Subject: Re: Batch INSERT failing with error 22P02

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group