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-21 06:43:16
Message-ID: Pine.BSO.4.64.0709210227150.1423@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Thu, 20 Sep 2007, Kris Jurka wrote:

> For the logging information, please rerun with loglevel=2 and upload
> just the last 10k lines of the file.
>

OK, with that info I'v finally managed to generate a reproducible test
case (attached). What happens is the driver sends:

Parse S_1
Describe S_1
Parse S_2
Sync

and when we get the results of S_1's describe we assign it to S_2
because there's only one active query at any time. So we've prepared
S_2 with one set of parameters, but now it thinks it was prepared with
S_1's. So next time we do:

Describe S_2
Sync

We get describe results which come from the server and have what S_2 was
parsed with and that doesn't match up with what the driver has for S_2 and
it bails out.

So the fix is probably to check that we aren't setting type information
from stale results, but this is a pretty complicated area, so I'd like to
study it a little more.

In any case, thanks for your help in tracking this one down.

Kris Jurka

Attachment Content-Type Size
ParamTypeProb.java text/plain 791 bytes
log.txt text/plain 4.1 KB

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Eric Faulhaber 2007-09-21 16:50:01 Re: Batch INSERT failing with error 22P02
Previous Message Kris Jurka 2007-09-20 19:38:44 Re: Batch INSERT failing with error 22P02