Re: cursors and for loops?

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Dennis <pg-user(at)calico-consulting(dot)com>
Cc: postgres SQL <pgsql-sql(at)postgresql(dot)org>
Subject: Re: cursors and for loops?
Date: 2004-04-15 14:50:33
Message-ID: 407EA139.2060807@Yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Just FYI, recent versions of PG use cursors internally for PL/pgSQL FOR
loops. So there is no danger for a procedure to run out of memory when
looping over a huge result set ... at least not because of that.

Jan

Dennis wrote:

> Tom Lane writes:
>
>> Something like
>>
>> LOOP
>> FETCH ...;
>> EXIT WHEN NOT found;
>> ...
>> END LOOP;
>
> Thank you! I tried finding documentation on "found" in this context and
> didn't come up with anything. Can you point me to where it is documented?
>
> Also, I am not getting the results I think I should be getting. Is there any
> kind of debug setting, or if not that, a way to output text (i.e. printf)
> from plpgsql?
>
> Thanks,
>
> Dennis
> pg-user(at)calico-consulting(dot)com
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Joe Conway 2004-04-15 16:10:07 Re: function returning array
Previous Message Dennis 2004-04-15 14:03:37 Re: function returning array