pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: gurkan@resolution.com
Cc: pgsql-jdbc@postgresql.org
Subject: Re: setting large bytea values
Date: Fri, 02 Sep 2005 11:44:29 +1200
Message-ID: <4317925D.1090105@opencloud.com> (raw)
In-Reply-To: <1125617538.43178f82aaebf@www.resolution.com>
References: <1125617538.43178f82aaebf@www.resolution.com>

(I added a useful subject line..)

gurkan@resolution.com wrote:

> I have been working on conversion program from Informix to PostgreSQL db, and I
> have a one table which has large data(bytea). 
> 
> I need to be able to copy this one row (docdata column) that I have which is
> close to 32MB. Program seems to read the data but cannot copy to postgres
> (PreparedStatement), it gives OutOfMemoryError. I ran the program with these
> heap too.
> java -Xms200m -Xmx700m AddDoc

What driver and server versions are you using? 8.0 drivers against a 7.4
or later server should handle this fine with no extra intermediate
copies of the stream.

> inp = new ByteArrayInputStream(wbout.toByteArray());
[...]
> 	postgresStmt.setBinaryStream (2, inp, inp.available());

You could also use setBytes() directly here, but either way should work.

-O



Message-ID: <4317925D.1090105@opencloud.com>
Permalink:  ../4317925D.1090105@opencloud.com/
Also on:    postgresql.org/message-id/4317925D.1090105@opencloud.com

 · 

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: oliver@opencloud.com, gurkan@resolution.com
  Subject: Re: setting large bytea values
  In-Reply-To: <4317925D.1090105@opencloud.com>
  References: <1125617538.43178f82aaebf@www.resolution.com> <4317925D.1090105@opencloud.com>

* 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