From: Kris Jurka <books@ejurka.com>
To: Altaf Malik <mmalik_altaf@yahoo.com>
Cc: Dave Cramer <pg@fastcrypt.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: JDBC causing the connection to close after executing a COPY command
Date: Thu, 13 Dec 2007 16:31:12 -0500 (EST)
Message-ID: <Pine.BSO.4.64.0712131616360.2084@leary.csoft.net> (raw)
In-Reply-To: <35579.58043.qm@web39104.mail.mud.yahoo.com>
References: <35579.58043.qm@web39104.mail.mud.yahoo.com>
On Thu, 13 Dec 2007, Altaf Malik wrote:
> I debugged little more and found that this is not because of incomplete
> copy support. When a response to any of the copy operations is received,
> JDBC reads next few bytes to ignore the response. But unfortunately
> driver reads extra four bytes which is the RFQ message so the RFQ
> message gets corrupted and IOException is thrown considering it as an
> unknown packet.
Good catch.
> I am attaching a patch that fixes this issue and driver works smoothly
> even after giving the error on copy response.
>
Sort of. In the case of copying data from the server, if you do have a
large table, you'll generate a SQLException for every row of the copy
result which isn't great, but I guess it's better than failing completely.
Trying to copy out a single column table of 100k integers took about seven
minutes and 150 MB of memory here.
Also, it doesn't work for copying data to the server. In that case the
server is sitting waiting for data and the driver is waiting for the
server and nothing happens. That was the case before, so this is no
worse.
Do you have plans to work on this further or shall I apply just this minor
improvement?
Kris Jurka
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, mmalik_altaf@yahoo.com, pg@fastcrypt.com
Subject: Re: JDBC causing the connection to close after executing a COPY command
In-Reply-To: <Pine.BSO.4.64.0712131616360.2084@leary.csoft.net>
References: <35579.58043.qm@web39104.mail.mud.yahoo.com> <Pine.BSO.4.64.0712131616360.2084@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