Re: Trouble with COPY IN

From: Kris Jurka <books(at)ejurka(dot)com>
To: pgsql-hackers(at)postgresql(dot)org, Matthew Wakeling <matthew(at)flymine(dot)org>
Cc: 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: Trouble with COPY IN
Date: 2010-07-22 21:34:08
Message-ID: alpine.BSO.2.00.1007221723230.16703@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-jdbc


Per discussion and investigation on the -jdbc list, the server appears to
violate the frontend/backend protocol when binary copy data is sent to the
server. Upon receiving the binary copy end of data marker (a -1 field
count), the server immediately responds with CommandComplete and
ReadyForQuery without waiting for the frontend to issue CopyDone or
CopyFail. This confuses the JDBC driver as it doesn't think the command
sequence should have finished yet.

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.

http://www.postgresql.org/docs/8.4/static/protocol-flow.html#PROTOCOL-COPY
http://www.postgresql.org/docs/8.4/static/sql-copy.html

Kris Jurka

Attachment Content-Type Size
binary-copy-end.patch text/plain 1.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Urbański 2010-07-22 22:56:02 Re: review: psql: edit function, show function commands patch
Previous Message Kjell Rune Skaaraas 2010-07-22 20:34:48 Re: Add column if not exists (CINE)

Browse pgsql-jdbc by date

  From Date Subject
Next Message Robert Haas 2010-07-23 00:55:13 Re: [HACKERS] Trouble with COPY IN
Previous Message Kris Jurka 2010-07-22 19:49:39 Re: Trouble with COPY IN