Re: [HACKERS] Trouble with COPY IN

Kris Jurka <books@ejurka.com>

From: Kris Jurka <books@ejurka.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers@postgresql.org, Matthew Wakeling <matthew@flymine.org>, Kevin Grittner <Kevin.Grittner@wicourts.gov>, Maciek Sakrejda <msakrejda@truviso.com>, Samuel Gendler <sgendler@ideasculptor.com>, pgsql-jdbc@postgresql.org
Date: 2010-07-23T13:23:55Z
Lists: pgsql-hackers

On Thu, 22 Jul 2010, Robert Haas wrote:

> On Thu, Jul 22, 2010 at 5:34 PM, Kris Jurka <books@ejurka.com> wrote:
>>
>> Attached is a patch to make the server continue to consume protocol data
>> until instructed to stop by the client in the same way as copying text data
>> to the server currently works.
>>
>
> I guess the obvious question is whether we shouldn't instead change
> the docs to match the behavior.  I suspect there's almost no chance
> we'd consider back-patching a change of this type, since it is a clear
> behavior change.  And even if we did, there would still be people
> running servers with the old behavior with which JDBC and other
> drivers would have to cope.  Having two different behaviors might be
> worse than the status quo.
>

It is a clear behavior change, but that's what bug fixes are.  I would 
advocate back-patching this because I doubt many people would be affected 
by this change and I think it would be awkward trying to document how 
things work differently in binary mode when sending a file end marker than 
in text mode or without a file end marker.  If this was fixed server side 
and backpatched, I would not modify the JDBC driver to work with older 
server versions.

The copy documentation is clear that you must call PQputCopyEnd or 
equivalent to end the copy sequence, so this would only affect people who 
are not doing that and using binary copy mode.  I doubt many people are 
using binary copy at all because of the additional difficulty in 
generating binary format data and the potential for portability problems.

Kris Jurka