From: Jan Wieck <JanWieck@Yahoo.com>
To: Dennis <pg-user@calico-consulting.com>
Cc: postgres SQL <pgsql-sql@postgresql.org>
Subject: Re: cursors and for loops?
Date: Thu, 15 Apr 2004 10:50:33 -0400
Message-ID: <407EA139.2060807@Yahoo.com> (raw)
In-Reply-To: <courier.40799269.00004AC6@wolverine.lercnetworks.com>
References: <courier.4078D0C7.00000C8F@wolverine.lercnetworks.com>
<15008.1081699255@sss.pgh.pa.us>
<courier.40799269.00004AC6@wolverine.lercnetworks.com>
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 #
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: JanWieck@Yahoo.com, pg-user@calico-consulting.com
Subject: Re: cursors and for loops?
In-Reply-To: <407EA139.2060807@Yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox