Skip site navigation (1) Skip section navigation (2)

Re: setting large bytea values

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: gurkan(at)resolution(dot)com
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: setting large bytea values
Date: 2005-09-01 23:44:29
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
(I added a useful subject line..)

gurkan(at)resolution(dot)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.


In response to

  • at 2005-09-01 23:32:18 from gurkan

pgsql-jdbc by date

Next:From: Joseph ShraibmanDate: 2005-09-02 03:38:21
Subject: Getting vacuum results
Previous:From: gurkanDate: 2005-09-01 23:32:18

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group