public inbox for [email protected]  
help / color / mirror / Atom feed
Suggested patch to plpgsql docs (7.4beta)
6+ messages / 5 participants
[nested] [flat]

* Suggested patch to plpgsql docs (7.4beta)
@ 2003-09-03 17:45 Richard Huxton <[email protected]>
  2003-09-03 22:17 ` Re: Suggested patch to plpgsql docs (7.4beta) Peter Eisentraut <[email protected]>
  2003-09-03 23:11 ` Re: Suggested patch to plpgsql docs (7.4beta) Bruce Momjian <[email protected]>
  0 siblings, 2 replies; 6+ messages in thread

From: Richard Huxton @ 2003-09-03 17:45 UTC (permalink / raw)
  To: pgsql-docs

Addition of one paragraph to the end of section 39.7.3.4 "FOR (integer 
variant)"

Note that this is basically a WHILE loop, so if the lower bound is larger than 
the upper bound the loop never executes it's contents:
  FOR i IN 10..1 LOOP
    RAISE NOTICE ''I do not raise a notice %'',i;
  END LOOP;

I wasn't sure and had to check, so I assume others might find this useful too.
-- 
  Richard Huxton
  Archonet Ltd



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Suggested patch to plpgsql docs (7.4beta)
  2003-09-03 17:45 Suggested patch to plpgsql docs (7.4beta) Richard Huxton <[email protected]>
@ 2003-09-03 22:17 ` Peter Eisentraut <[email protected]>
  1 sibling, 0 replies; 6+ messages in thread

From: Peter Eisentraut @ 2003-09-03 22:17 UTC (permalink / raw)
  To: Richard Huxton <[email protected]>; +Cc: pgsql-docs

Richard Huxton writes:

> Addition of one paragraph to the end of section 39.7.3.4 "FOR (integer
> variant)"
>
> Note that this is basically a WHILE loop, so if the lower bound is larger than
> the upper bound the loop never executes it's contents:

I've added a note to this effect.  Thanks.

-- 
Peter Eisentraut   [email protected]




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Suggested patch to plpgsql docs (7.4beta)
  2003-09-03 17:45 Suggested patch to plpgsql docs (7.4beta) Richard Huxton <[email protected]>
@ 2003-09-03 23:11 ` Bruce Momjian <[email protected]>
  2003-09-04 00:20   ` Re: Suggested patch to plpgsql docs (7.4beta) Philip Yarra <[email protected]>
  2003-09-04 03:32   ` Re: Suggested patch to plpgsql docs (7.4beta) Tom Lane <[email protected]>
  1 sibling, 2 replies; 6+ messages in thread

From: Bruce Momjian @ 2003-09-03 23:11 UTC (permalink / raw)
  To: Richard Huxton <[email protected]>; +Cc: pgsql-docs

Richard Huxton wrote:
> Addition of one paragraph to the end of section 39.7.3.4 "FOR (integer 
> variant)"
> 
> Note that this is basically a WHILE loop, so if the lower bound is larger than 
> the upper bound the loop never executes it's contents:
>   FOR i IN 10..1 LOOP
>     RAISE NOTICE ''I do not raise a notice %'',i;
>   END LOOP;
> 
> I wasn't sure and had to check, so I assume others might find this useful too.

I figured everyone would assume that.  I know of no language that will
execute a loop listed as 10 ... 1.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  [email protected]               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Suggested patch to plpgsql docs (7.4beta)
  2003-09-03 17:45 Suggested patch to plpgsql docs (7.4beta) Richard Huxton <[email protected]>
  2003-09-03 23:11 ` Re: Suggested patch to plpgsql docs (7.4beta) Bruce Momjian <[email protected]>
@ 2003-09-04 00:20   ` Philip Yarra <[email protected]>
  1 sibling, 0 replies; 6+ messages in thread

From: Philip Yarra @ 2003-09-04 00:20 UTC (permalink / raw)
  To: Bruce Momjian <[email protected]>; Richard Huxton <[email protected]>; +Cc: pgsql-docs

On Thu, 4 Sep 2003 09:11 am, Bruce Momjian wrote:
> Richard Huxton wrote:
> > Addition of one paragraph to the end of section 39.7.3.4 "FOR (integer
> > variant)"
> >
> > Note that this is basically a WHILE loop, so if the lower bound is larger
> > than the upper bound the loop never executes it's contents:
> >   FOR i IN 10..1 LOOP
> >     RAISE NOTICE ''I do not raise a notice %'',i;
> >   END LOOP;
> >
> > I wasn't sure and had to check, so I assume others might find this useful
> > too.
>
> I figured everyone would assume that.  I know of no language that will
> execute a loop listed as 10 ... 1.

Basic on my first computer suppported it, though the syntax was 

FOR $i in 10 TO 1 STEP -1
	PRINT $i
NEXT 

I think it is worth stating explicitly. The apostrophe in "it's" is incorrect 
though.

Regards, Philip Yarra.



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Suggested patch to plpgsql docs (7.4beta)
  2003-09-03 17:45 Suggested patch to plpgsql docs (7.4beta) Richard Huxton <[email protected]>
  2003-09-03 23:11 ` Re: Suggested patch to plpgsql docs (7.4beta) Bruce Momjian <[email protected]>
@ 2003-09-04 03:32   ` Tom Lane <[email protected]>
  2003-09-04 06:23     ` Re: Suggested patch to plpgsql docs (7.4beta) Richard Huxton <[email protected]>
  1 sibling, 1 reply; 6+ messages in thread

From: Tom Lane @ 2003-09-04 03:32 UTC (permalink / raw)
  To: Bruce Momjian <[email protected]>; +Cc: Richard Huxton <[email protected]>; pgsql-docs

Bruce Momjian <[email protected]> writes:
> I figured everyone would assume that.  I know of no language that will
> execute a loop listed as 10 ... 1.

Fortran N for N < something-or-other.  I think Richard is betraying
his age ;-)

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Suggested patch to plpgsql docs (7.4beta)
  2003-09-03 17:45 Suggested patch to plpgsql docs (7.4beta) Richard Huxton <[email protected]>
  2003-09-03 23:11 ` Re: Suggested patch to plpgsql docs (7.4beta) Bruce Momjian <[email protected]>
  2003-09-04 03:32   ` Re: Suggested patch to plpgsql docs (7.4beta) Tom Lane <[email protected]>
@ 2003-09-04 06:23     ` Richard Huxton <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Richard Huxton @ 2003-09-04 06:23 UTC (permalink / raw)
  To: Tom Lane <[email protected]>; Bruce Momjian <[email protected]>; +Cc: pgsql-docs

On Thursday 04 September 2003 04:32, Tom Lane wrote:
> Bruce Momjian <[email protected]> writes:
> > I figured everyone would assume that.  I know of no language that will
> > execute a loop listed as 10 ... 1.

I did assume that, then my paranoia kicked in suggesting it might be 
constructing a list of values and stepping through them. The only reason I 
could think it should behave like a while loop is that, well, all the others 
do.

> Fortran N for N < something-or-other.  I think Richard is betraying
> his age ;-)

And how DARE you Tom - I clearly meant DotJavaWebSysNet or something trendy 
like that and not some crufty version of BASIC from my 6502 days....;-)

-- 
  Richard Huxton
  Archonet Ltd




^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2003-09-04 06:23 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-09-03 17:45 Suggested patch to plpgsql docs (7.4beta) Richard Huxton <[email protected]>
2003-09-03 22:17 ` Peter Eisentraut <[email protected]>
2003-09-03 23:11 ` Bruce Momjian <[email protected]>
2003-09-04 00:20   ` Philip Yarra <[email protected]>
2003-09-04 03:32   ` Tom Lane <[email protected]>
2003-09-04 06:23     ` Richard Huxton <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox