Re: cursors and for loops? - Mailing list pgsql-sql

From Jan Wieck
Subject Re: cursors and for loops?
Date
Msg-id 407EA139.2060807@Yahoo.com
Whole thread Raw
In response to Re: cursors and for loops?  ("Dennis" <pg-user@calico-consulting.com>)
List 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@calico-consulting.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@Yahoo.com #



pgsql-sql by date:

Previous
From: "Dennis"
Date:
Subject: Re: function returning array
Next
From: Christoph Haller
Date:
Subject: Re: Row count after SELECT INTO?