Re: Out of memory error on huge resultset

From: Aaron Mulder <ammulder(at)alumni(dot)princeton(dot)edu>
To: pgsql-jdbc <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Out of memory error on huge resultset
Date: 2002-10-12 12:04:13
Message-ID: Pine.LNX.4.44.0210120758360.1878-100000@www.princetongames.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On 12 Oct 2002, Nic Ferrier wrote:
> That's a really good point Barry. I never do that so it's not
> something I'd considered.
>
> Isn't a solution to only do the to_cursor translation when the
> statement given begins with "SELECT "?

Well, there's always the case of "select * from
really_small_table; insert into reall_small table; select * from
really_big_table;..."

In practice, I've used some 100+ statement commands, because we
run updates to one or our internal databases in DBVisualizer, and it
passes the entire script as one command. On the other hand, those are all
updates, but there's nothing preventing you from putting some selects in
there.

I think it's best to do what Barry mentioned and disable this for
statements containing a ; (or at least containing a ; with any non
whitespace thereafter). Then just consider whether you want to search for
quoted/escaped ;s.

Aaron

> I agree that it's far from perfect, but it will do for _most_ cases
> won't it?
>
>
> Interestingly, I don't think what you've speced above is even
> possible with some databases is it? Another advantage of using
> PostgreSQL is that you must properly terminate your SQL statements,
> unlike with some commercial databases I could mention.

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Nic Ferrier 2002-10-12 12:20:49 Re: Out of memory error on huge resultset
Previous Message Nic Ferrier 2002-10-12 11:42:38 Re: Out of memory error on huge resultset