Re: are cursors necessary? - Mailing list pgsql-general

From Jan Wieck
Subject Re: are cursors necessary?
Date
Msg-id 3FCFC733.9000906@Yahoo.com
Whole thread Raw
In response to Re: are cursors necessary?  (Richard Huxton <dev@archonet.com>)
Responses Re: are cursors necessary?  (Mike Mascari <mascarm@mascari.com>)
List pgsql-general
Richard Huxton wrote:

> On Thursday 04 December 2003 22:46, Mark Harrison wrote:
>>     res = PQexec(conn, "BEGIN");
>>     res = PQexec(conn, "DECLARE myportal CURSOR FOR select * from
>> pg_database"); res = PQexec(conn, "FETCH ALL in myportal");
>>     res = PQexec(conn, "CLOSE myportal");
>>     res = PQexec(conn, "END");
>
>> Is there any value in my own query-only programs to declaring the cursor
>> for each search?
>
> Well - if you want to scroll forward/backward through the resultset, you'd
> want a cursor. Or, if your client had limited memory and the resultset was
> large you might want to do so. PG will return all rows at once, so if your
> SELECT returns 5 million rows you'll use a lot of RAM on the client side.
>

You really think people would ever want to store more than 640 rows?


Jan

--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #


pgsql-general by date:

Previous
From: Jan Wieck
Date:
Subject: Re: Money data type in PostgreSQL?
Next
From:
Date:
Subject: XOR on strings