Re: cursors and for loops?

Поиск
Список
Период
Сортировка
От Jan Wieck
Тема Re: cursors and for loops?
Дата
Msg-id 407EA139.2060807@Yahoo.com
обсуждение исходный текст
Ответ на Re: cursors and for loops?  ("Dennis" <pg-user@calico-consulting.com>)
Список 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 по дате отправления:

Предыдущее
От: "Dennis"
Дата:
Сообщение: Re: function returning array
Следующее
От: Christoph Haller
Дата:
Сообщение: Re: Row count after SELECT INTO?