Received: from candle.pha.pa.us (candle.navpoint.com [162.33.245.46]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f9CLJgr34627 for ; Fri, 12 Oct 2001 17:19:42 -0400 (EDT) (envelope-from pgman@candle.pha.pa.us) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.10.1) id f9CLJVh27152; Fri, 12 Oct 2001 17:19:31 -0400 (EDT) From: Bruce Momjian Message-Id: <200110122119.f9CLJVh27152@candle.pha.pa.us> Subject: Re: FOR i IN REVERSE documentation error? In-Reply-To: <3BC11899.F5DE8D90@bostoninformation.com> "from Norman Megill at Oct 7, 2001 11:08:09 pm" To: Norman Megill Date: Fri, 12 Oct 2001 17:19:31 -0400 (EDT) CC: pgsql-docs@postgresql.org X-Mailer: ELM [version 2.4ME+ PL90 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Archive-Number: 200110/35 X-Sequence-Number: 1049 I can confirm in testing this function that you are correct. I have fixed the documentation as you suggested. Thanks. --------------------------------------------------------------------------- drop function bb(); create function bb () returns integer as 'declare i integer; begin for i in reverse 10..1 LOOP insert into aa values (i); END LOOP; return 0; end' LANGUAGE 'plpgsql'; > In the 7.2 documentation, Section 23.2.6.2, at > http://postgresql.crimelabs.net/devel-corner/docs/postgres/plpgsql-description.html > > it shows the example: > > FOR i IN REVERSE 1..10 LOOP > -- some expressions here > END LOOP; > > This loop does nothing. I think it should be: > > FOR i IN REVERSE 10..1 LOOP > -- some expressions here > END LOOP; > > which does work (10 iterations). > > Note: This error is also in the 7.1 documentation. I tested > it in 7.1 but not 7.2. > > Thank you, > Norm Megill > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/users-lounge/docs/faq.html > -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026