Re: Out of memory error on huge resultset

From: Barry Lind <barry(at)xythos(dot)com>
To: Nic Ferrier <nferrier(at)tapsellferrier(dot)co(dot)uk>
Cc: Dave Cramer <Dave(at)micro-automation(dot)net>, pgsql-jdbc <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Out of memory error on huge resultset
Date: 2002-10-12 03:31:25
Message-ID: 3DA7978D.5090008@xythos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Jeff Davis 2002-10-12 04:18:23 Re: MySQL vs PostgreSQL.
Previous Message Alvaro Herrera 2002-10-12 02:16:24 Re: MySQL vs PostgreSQL.