X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 5088AD1D085 for ; Thu, 15 Apr 2004 11:50:49 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 69117-03 for ; Thu, 15 Apr 2004 11:50:51 -0300 (ADT) Received: from smtp017.mail.yahoo.com (smtp017.mail.yahoo.com [216.136.174.114]) by svr1.postgresql.org (Postfix) with SMTP id E4BFAD1D083 for ; Thu, 15 Apr 2004 11:50:46 -0300 (ADT) Received: from unknown (HELO europa.janwieck.net) (janwieck@68.80.245.191 with login) by smtp017.mail.yahoo.com with SMTP; 15 Apr 2004 14:50:50 -0000 Received: from Yahoo.com (ismtp.afilias.com [216.217.55.254]) (authenticated) by europa.janwieck.net (8.11.6/8.11.6) with ESMTP id i3FEogj01028; Thu, 15 Apr 2004 10:50:49 -0400 Message-ID: <407EA139.2060807@Yahoo.com> Date: Thu, 15 Apr 2004 10:50:33 -0400 From: Jan Wieck User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Dennis Cc: postgres SQL Subject: Re: cursors and for loops? References: <15008.1081699255@sss.pgh.pa.us> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200404/139 X-Sequence-Number: 17514 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 #