Re: Out of memory error on huge resultset - Mailing list pgsql-jdbc

From Barry Lind
Subject Re: Out of memory error on huge resultset
Date
Msg-id 3DA7978D.5090008@xythos.com
Whole thread Raw
In response to Re: Out of memory error on huge resultset  ("Simpson, Mike W" <mike.simpson@pbs.proquest.com>)
Responses Re: Out of memory error on huge resultset
List pgsql-jdbc

Nic Ferrier wrote:

> So I'm simply transforming querys from:
>
>
>     SELECT x FROM y WHERE z;
>
>
> into
>
>     DECLARE jdbcXX CURSOR FOR $query ;
>     FETCH FORWARD $fetchSize jdbcXX;
>

And when $query is:  "insert into foo values (...); select * from bar;"

You will get:
DECLARE jdbcXX CURSOR FOR insert into foo values (...);
select * from bar;
FETCH FORWARD $fetchSize jdbcXX;

Which clearly isn't what you want.

So like the discussion that we had on when we should/could use server
side prepared statements either the default needs to be not to use
cursors, or the sql string needs to be parsed looking for ';' and only
use cursors if no ';' is found.

thanks,
--Barry



pgsql-jdbc by date:

Previous
From: Nic Ferrier
Date:
Subject: Re: Out of memory error on huge resultset
Next
From: "Bernd Brenner"
Date:
Subject: Re: pq_recvbuf: recv() failed: Connection reset by peer