Re: Trouble with COPY IN - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: Trouble with COPY IN
Date
Msg-id alpine.BSO.2.00.1007201455220.5084@leary.csoft.net
Whole thread Raw
In response to Re: Trouble with COPY IN  (Matthew Wakeling <matthew@flymine.org>)
Responses Re: Trouble with COPY IN  (Matthew Wakeling <matthew@flymine.org>)
Re: Trouble with COPY IN  (Kris Jurka <books@ejurka.com>)
List pgsql-jdbc

On Tue, 20 Jul 2010, Matthew Wakeling wrote:

> Okay, have investigated a little further. It seems that the server may be
> responding to the client a little too quickly with the "all done" message.
> Here is a sequence of events in core.v3.QueryExecutorImpl:
>
> We call startCopy(). It calls processCopyResults().
> In processCopyResults, we receive character G, and we lock.
>
> We call writeToCopy(). It calls processCopyResults().
> We receive character C.
> We receive character Z, and unlock.
>
> We call endCopy(), which tries to unlock and fails.
>
>
> So, should the unlocking happen elsewhere, or should endCopy not require a
> lock?

To me it seems like a protocol violation to receive CommandComplete(C) and
ReadyForQuery(Z) before we've issued CopyDone(c) and this should be fixed
server side.

Kris Jurka

pgsql-jdbc by date:

Previous
From: Matthew Wakeling
Date:
Subject: Re: Trouble with COPY IN
Next
From: Radosław Smogura
Date:
Subject: Binary protocol support for JDBC