pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feedFOR i IN REVERSE documentation error?
2+ messages / 2 participants
[nested] [flat]
* FOR i IN REVERSE documentation error?
@ 2001-10-08 03:08 Norman Megill <nmegill@bostoninformation.com>
2001-10-12 21:19 ` Re: FOR i IN REVERSE documentation error? Bruce Momjian <pgman@candle.pha.pa.us>
0 siblings, 1 reply; 2+ messages in thread
From: Norman Megill @ 2001-10-08 03:08 UTC (permalink / raw)
To: pgsql-docs
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
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: FOR i IN REVERSE documentation error?
2001-10-08 03:08 FOR i IN REVERSE documentation error? Norman Megill <nmegill@bostoninformation.com>
@ 2001-10-12 21:19 ` Bruce Momjian <pgman@candle.pha.pa.us>
0 siblings, 0 replies; 2+ messages in thread
From: Bruce Momjian @ 2001-10-12 21:19 UTC (permalink / raw)
To: Norman Megill <nmegill@bostoninformation.com>; +Cc: pgsql-docs
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
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2001-10-12 21:19 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-10-08 03:08 FOR i IN REVERSE documentation error? Norman Megill <nmegill@bostoninformation.com>
2001-10-12 21:19 ` Bruce Momjian <pgman@candle.pha.pa.us>
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