Re: are cursors necessary?

From: Mike Mascari <mascarm(at)mascari(dot)com>
To: Jan Wieck <JanWieck(at)Yahoo(dot)com>
Cc: Richard Huxton <dev(at)archonet(dot)com>, Mark Harrison <mh(at)pixar(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: are cursors necessary?
Date: 2003-12-05 01:01:32
Message-ID: 3FCFD8EC.6020908@mascari.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jan Wieck wrote:

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

Ha ha! With each one being 1K? You, sir, have a wicked sense of humor...

Mike Mascari
mascarm(at)mascari(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message pg 2003-12-05 01:21:56 last update time of a table
Previous Message btober 2003-12-05 00:56:08 XOR on strings