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

Re: Trouble with COPY IN

From: Matthew Wakeling <matthew(at)flymine(dot)org>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: Maciek Sakrejda <msakrejda(at)truviso(dot)com>, Samuel Gendler <sgendler(at)ideasculptor(dot)com>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Trouble with COPY IN
Date: 2010-07-20 14:12:25
Message-ID: alpine.DEB.2.00.1007201507500.8895@aragorn.flymine.org (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-jdbc
On Tue, 20 Jul 2010, Matthew Wakeling wrote:
> After a little more investigation, it appears that 
> core.v3.QueryExecutorImpl.unlock() is being called before 
> core.v3.QueryExecutorImpl.endCopy(), in 
> core.v3.QueryExecutorImpl.processCopyResults() apparently because it receives 
> a "Z", called by core.v3.QueryExecutorImpl.writeToCopy(). Investigating 
> further.

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?

Matthew

-- 
 Jadzia: Don't forget the 34th rule of acquisition: Peace is good for business.
 Quark:  That's the 35th.
 Jadzia: Oh yes, that's right. What's the 34th again?
 Quark:  War is good for business. It's easy to get them mixed up.

In response to

Responses

pgsql-hackers by date

Next:From: Robert HaasDate: 2010-07-20 14:14:51
Subject: Re: psql \conninfo command (was: Patch: psql \whoami option)
Previous:From: Robert HaasDate: 2010-07-20 14:05:04
Subject: Re: Explicit psqlrc

pgsql-jdbc by date

Next:From: Matthew WakelingDate: 2010-07-20 14:55:18
Subject: Re: Trouble with COPY IN
Previous:From: Matthew WakelingDate: 2010-07-20 13:56:49
Subject: Re: Trouble with COPY IN

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