pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: James William Pye <lists@jwp.name>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgresql.org, Matthew Wakeling <matthew@flymine.org>
Cc: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: Maciek Sakrejda <msakrejda@truviso.com>
Cc: Samuel Gendler <sgendler@ideasculptor.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: [HACKERS] Trouble with COPY IN
Date: Sun, 25 Jul 2010 11:01:48 -0400 (EDT)
Message-ID: <alpine.BSO.2.00.1007251041530.16933@leary.csoft.net> (raw)
In-Reply-To: <7E743A09-D012-4BBB-9B87-24CA1DF51015@jwp.name>
References: <alpine.DEB.2.00.1007161753160.8895@aragorn.flymine.org>
	<alpine.DEB.2.00.1007191455550.8895@aragorn.flymine.org>
	<alpine.DEB.2.00.1007191514510.8895@aragorn.flymine.org>
	<AANLkTimCYa3fvWu2-NwcUc_7GibTpFB1RjNC09IVk8IS@mail.gmail.com>
	<alpine.DEB.2.00.1007201114080.8895@aragorn.flymine.org>
	<alpine.DEB.2.00.1007201128560.8895@aragorn.flymine.org>
	<AANLkTinVNt56ZuxRf0KNgBR-kJPN1NkTgDkHY2DXIPQr@mail.gmail.com>
	<alpine.DEB.2.00.1007201229110.8895@aragorn.flymine.org>
	<alpine.DEB.2.00.1007201422270.8895@aragorn.flymine.org>
	<4C4562C50200002500033951@gw.wicourts.gov>
	<alpine.DEB.2.00.1007201452360.8895@aragorn.flymine.org>
	<alpine.DEB.2.00.1007201507500.8895@aragorn.flymine.org>
	<alpine.BSO.2.00.1007201455220.5084@leary.csoft.net>
	<alpine.BSO.2.00.1007221723230.16703@leary.csoft.net>
	<9143.1279892435@sss.pgh.pa.us>
	<4C499E26.4060307@ejurka.com>
	<9653.1279894296@sss.pgh.pa.us>
	<7E743A09-D012-4BBB-9B87-24CA1DF51015@jwp.name>



On Sat, 24 Jul 2010, James William Pye wrote:

> On Jul 23, 2010, at 7:11 AM, Tom Lane wrote:
>> I can't help thinking that the JDBC driver must be being overly cute
>> if this breaks it ...
>
> I was wondering the same thing when I first saw Kris' message. However, 
> iff I understand what JDBC is trying to achieve, I don't think I would 
> call it "overly".
>
> Is this a problem because JDBC is trying to detect failures as early as 
> possible during a COPY IN? Or, is it just JDBC's normal MO to always be 
> reading?

The JDBC driver reads server messages for multiple reasons.  One of them 
is indeed to do early failure detection.  Another is to pickup 
NoticeResponse messages to avoid a network buffer deadlock.  If someone 
puts a trigger on the table you're copying data into that does RAISE 
NOTICE 'received row X' for each row, to avoid a full network buffer 
deadlock, the client must regularly read from the backend.  So as we are 
reading along, supposing that we're still mid-copy, we get a command 
complete message.  So this is possible to work around driver side by 
peeking into the network stream and delaying processing of the end of copy 
until the driver agrees that the copy is done, but I still maintain that 
this is a server bug.  It is not OK for the server to assume that the 
client is done and move on, the client must tell the server what it wants 
done.

Kris Jurka



view thread (48+ messages)  latest in thread

Message-ID: <alpine.BSO.2.00.1007251041530.16933@leary.csoft.net>
Permalink:  ../alpine.BSO.2.00.1007251041530.16933@leary.csoft.net/
Also on:    postgresql.org/message-id/alpine.BSO.2.00.1007251041530.16933@leary.csoft.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: books@ejurka.com, lists@jwp.name, tgl@sss.pgh.pa.us, matthew@flymine.org, Kevin.Grittner@wicourts.gov, msakrejda@truviso.com, sgendler@ideasculptor.com
  Subject: Re: [HACKERS] Trouble with COPY IN
  In-Reply-To: <alpine.BSO.2.00.1007251041530.16933@leary.csoft.net>
  References: <alpine.DEB.2.00.1007161753160.8895@aragorn.flymine.org> <alpine.DEB.2.00.1007191455550.8895@aragorn.flymine.org> <alpine.DEB.2.00.1007191514510.8895@aragorn.flymine.org> <AANLkTimCYa3fvWu2-NwcUc_7GibTpFB1RjNC09IVk8IS@mail.gmail.com> <alpine.DEB.2.00.1007201114080.8895@aragorn.flymine.org> <alpine.DEB.2.00.1007201128560.8895@aragorn.flymine.org> <AANLkTinVNt56ZuxRf0KNgBR-kJPN1NkTgDkHY2DXIPQr@mail.gmail.com> <alpine.DEB.2.00.1007201229110.8895@aragorn.flymine.org> <alpine.DEB.2.00.1007201422270.8895@aragorn.flymine.org> <4C4562C50200002500033951@gw.wicourts.gov> <alpine.DEB.2.00.1007201452360.8895@aragorn.flymine.org> <alpine.DEB.2.00.1007201507500.8895@aragorn.flymine.org> <alpine.BSO.2.00.1007201455220.5084@leary.csoft.net> <alpine.BSO.2.00.1007221723230.16703@leary.csoft.net> <9143.1279892435@sss.pgh.pa.us> <4C499E26.4060307@ejurka.com> <9653.1279894296@sss.pgh.pa.us> <7E743A09-D012-4BBB-9B87-24CA1DF51015@jwp.name> <alpine.BSO.2.00.1007251041530.16933@leary.csoft.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox