Cannot Retrieve Binary Data - Mailing list pgsql-jdbc

From patrick
Subject Cannot Retrieve Binary Data
Date
Msg-id 5bd6ef364cb5f644245035172a720b30@freeshell.org
Whole thread Raw
List pgsql-jdbc
Hi all ,
i'm following the example at
http://www.postgresql.org/docs/7.4/interactive/jdbc-binary-data.html
trying to retrieve previous stored  file (more than 600MB) using the
following code:

            Jdbc3ConnectionPool source = new Jdbc3ConnectionPool();
            conn =
DriverManager.getConnection("jdbc:postgresql://localhost/backup",
"test", "test");
            conn.setAutoCommit(false);
                   PreparedStatement ps = conn.prepareStatement("SELECT img
FROM images WHERE imgname = ?");
            ps.setString(1, "civil.dmg");
            ResultSet rs = ps.executeQuery();
            if (rs != null) {
                while (rs.next()) {
                    byte[] imgBytes = rs.getBytes(1);
                    // use the data in some way here
                }
                rs.close();
            }
            ps.close();
            conn.commit();

during the executeQuery() i got a the following exception

java.sql.SQLException: ERROR: invalid memory alloc request size
2017394403

The Postgres version is 8.0.1 (compiled from source with default
settings ) running on Darwin Kernel Version 7.8.0

Thanks in advance for any help

-patrick


pgsql-jdbc by date:

Previous
From: "Rover, Mischa de"
Date:
Subject: Re: Crystal Reports: Connection rejected: FATAL: no
Next
From: Sergio Lob
Date:
Subject: Re: [BUGS] BUG #1523: precision column value returned from