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

Re: [HACKERS] Trouble with COPY IN

From: Kris Jurka <books(at)ejurka(dot)com>
To: James William Pye <lists(at)jwp(dot)name>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org, Matthew Wakeling <matthew(at)flymine(dot)org>, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, Maciek Sakrejda <msakrejda(at)truviso(dot)com>, Samuel Gendler <sgendler(at)ideasculptor(dot)com>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [HACKERS] Trouble with COPY IN
Date: 2010-07-28 16:53:49
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-jdbc

On Wed, 28 Jul 2010, James William Pye wrote:

> hrm, I suppose a lazy way around that problem would be to suspend all 
> client messages(client_min_messages) during COPY IN. Tho, I guess one 
> would still have to contend with NotificationResponse, and 
> ParameterStatus..

Technically you won't get NotificationResponse until transaction end, so 
you don't need to worry about that mid copy.

> I don't think you would have to peek in. If the interface were to always 
> hold onto the last message or last n-bytes submitted to be sent, it 
> would be able to send the possible CopyData(EOF) and CopyDone once the 
> COPY operation (at the interface level) is closed/shutdown/terminated. 
> Granted, this is dependent on CopyData(EOF) not being in the middle of 
> regular CopyData, but I gather that that would end in an ErrorResponse 
> anyways.

One of the key points of confusion is that CopyData(EOF) does not result 
in an error.  It results in ignoring any futher data.  The problem I have 
is that for text mode it waits for CopyDone, but in binary mode it ends 
the copy sequence immediately.  Additionally the interface exposed by the 
JDBC driver lets the user write arbitrary CopyData bytes to the server, so 
without parsing all of that we don't know whether they've issued 
CopyData(EOF) or not.

Kris Jurka

In response to


pgsql-hackers by date

Next:From: Jeff DavisDate: 2010-07-28 17:18:28
Subject: Re: page corruption on 8.3+ that makes it to standby
Previous:From: Tom LaneDate: 2010-07-28 16:36:36
Subject: Re: page corruption on 8.3+ that makes it to standby

pgsql-jdbc by date

Next:From: Kris JurkaDate: 2010-07-28 16:57:58
Subject: Re: Wrong SqlType for boolean columns
Previous:From: James William PyeDate: 2010-07-28 16:31:32
Subject: Re: [HACKERS] Trouble with COPY IN

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