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 97A0CD1D1B8 for ; Tue, 13 Apr 2004 05:31:19 -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 85013-08 for ; Tue, 13 Apr 2004 05:31:19 -0300 (ADT) Received: from anchor-post-37.mail.demon.net (anchor-post-36.mail.demon.net [194.217.242.86]) by svr1.postgresql.org (Postfix) with ESMTP id CE4D4D1B49B for ; Tue, 13 Apr 2004 05:31:17 -0300 (ADT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-37.mail.demon.net with esmtp (Exim 3.35 #1) id 1BDJKA-000Bk9-0b; Tue, 13 Apr 2004 09:31:18 +0100 Received: by mainbox.archonet.com (Postfix, from userid 529) id 0DDC21622E; Tue, 13 Apr 2004 09:31:16 +0100 (BST) Received: from client17.archonet.com (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id E5D6116219; Tue, 13 Apr 2004 09:31:09 +0100 (BST) From: Richard Huxton To: "Dennis" , "postgres SQL" Subject: Re: cursors and for loops? Date: Tue, 13 Apr 2004 09:31:09 +0100 User-Agent: KMail/1.5 References: <15008.1081699255@sss.pgh.pa.us> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200404130931.09295.dev@archonet.com> X-Bogosity: No, tests=bogofilter, spamicity=0.000000, version=0.15.3 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200404/115 X-Sequence-Number: 17490 On Sunday 11 April 2004 19:46, 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? In my 7.3.x docs, at the end "Basic statements" section of the "plpgsql" chapter. There is only one sentence on it. > 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? RAISE NOTICE ''var1 = %, var2 = %'', var1, var2; Note - you need this format, you can't mix and match expressions etc. -- Richard Huxton Archonet Ltd