pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Eric Faulhaber <ecf@goldencode.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Batch INSERT failing with error 22P02
Date: Thu, 20 Sep 2007 13:35:02 -0400 (EDT)
Message-ID: <Pine.BSO.4.64.0709201251280.22675@leary.csoft.net> (raw)
In-Reply-To: <46F29BBC.20400@goldencode.com>
References: <46EEE4EF.80608@goldencode.com>
	<Pine.BSO.4.64.0709171802240.11213@leary.csoft.net>
	<46EFF277.1090309@goldencode.com>
	<Pine.BSO.4.64.0709181916350.449@leary.csoft.net>
	<46F29BBC.20400@goldencode.com>



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:

http://www.ejurka.com/pgsql/jars/ecf/

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



view thread (16+ messages)  latest in thread

Message-ID: <Pine.BSO.4.64.0709201251280.22675@leary.csoft.net>
Permalink:  ../Pine.BSO.4.64.0709201251280.22675@leary.csoft.net/
Also on:    postgresql.org/message-id/Pine.BSO.4.64.0709201251280.22675@leary.csoft.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: books@ejurka.com, ecf@goldencode.com
  Subject: Re: Batch INSERT failing with error 22P02
  In-Reply-To: <Pine.BSO.4.64.0709201251280.22675@leary.csoft.net>
  References: <46EEE4EF.80608@goldencode.com> <Pine.BSO.4.64.0709171802240.11213@leary.csoft.net> <46EFF277.1090309@goldencode.com> <Pine.BSO.4.64.0709181916350.449@leary.csoft.net> <46F29BBC.20400@goldencode.com> <Pine.BSO.4.64.0709201251280.22675@leary.csoft.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox