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: alpine.BSO.2.00.1007281249290.9018@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-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

Responses

Browse pgsql-hackers by date

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

Browse pgsql-jdbc by date

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