Re: Out of memory error on huge resultset

Поиск
Список
Период
Сортировка
От Nic Ferrier
Тема Re: Out of memory error on huge resultset
Дата
Msg-id 87adljzxw1.fsf@pooh-sticks-bridge.tapsellferrier.co.uk
обсуждение исходный текст
Ответ на Re: Out of memory error on huge resultset  (Barry Lind <barry@xythos.com>)
Ответы Re: Out of memory error on huge resultset  (Aaron Mulder <ammulder@alumni.princeton.edu>)
cursor based result sets not updateable  (Dave Cramer <Dave@micro-automation.net>)
Список pgsql-jdbc
Barry Lind <barry@xythos.com> writes:

> 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.

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 "?

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.


Nic

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: "Bernd Brenner"
Дата:
Сообщение: Re: pq_recvbuf: recv() failed: Connection reset by peer
Следующее
От: Aaron Mulder
Дата:
Сообщение: Re: Out of memory error on huge resultset