Re: [HACKERS] plpgsql FOR loop doesn't guard against strange step values

2007-07-17 Thread Tom Lane
"Jaime Casanova" <[EMAIL PROTECTED]> writes: > http://archives.postgresql.org/pgsql-committers/2007-07/msg00142.php > at least the part that prevents overflow and probably the one that > reject zero in BY are clearly bugs and should be backpatched to 8.2, > aren't they? Well, it's a behavioral cha

Re: [HACKERS] plpgsql FOR loop doesn't guard against strange step values

2007-07-16 Thread Jaime Casanova
On 7/14/07, Tom Lane <[EMAIL PROTECTED]> wrote: I just noticed that when the BY option was added to plpgsql FOR loops, no real error checking was done. If you specify a zero step value, you'll have an infinite loop. If you specify a negative value, the loop variable will increment in the "wrong

Re: [HACKERS] plpgsql FOR loop doesn't guard against strange step values

2007-07-14 Thread Andrew Dunstan
Tom Lane wrote: Andrew Dunstan <[EMAIL PROTECTED]> writes: I suspect we have a significant incompatibility with PLSQL in this area. Ugh. Google seems to confirm your thought that Oracle expects FOR i IN REVERSE 1..10 LOOP which is not the way we are doing it. Not sure

Re: [HACKERS] plpgsql FOR loop doesn't guard against strange step values

2007-07-14 Thread Tom Lane
Andrew Dunstan <[EMAIL PROTECTED]> writes: > I suspect we have a significant incompatibility with PLSQL in this area. Ugh. Google seems to confirm your thought that Oracle expects > FOR i IN REVERSE 1..10 LOOP which is not the way we are doing it. Not sure if it's worth trying to fix this -

Re: [HACKERS] plpgsql FOR loop doesn't guard against strange step values

2007-07-14 Thread Andrew Dunstan
Tom Lane wrote: Peter Eisentraut <[EMAIL PROTECTED]> writes: Tom Lane wrote: I just noticed that when the BY option was added to plpgsql FOR loops, no real error checking was done. If you specify a zero step value, you'll have an infinite loop. If you specify a negative value, the l

Re: [HACKERS] plpgsql FOR loop doesn't guard against strange step values

2007-07-14 Thread Tom Lane
Peter Eisentraut <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> I just noticed that when the BY option was added to plpgsql FOR >> loops, no real error checking was done. If you specify a zero step >> value, you'll have an infinite loop. If you specify a negative >> value, the loop variable wil

Re: [HACKERS] plpgsql FOR loop doesn't guard against strange step values

2007-07-14 Thread Peter Eisentraut
Tom Lane wrote: > I just noticed that when the BY option was added to plpgsql FOR > loops, no real error checking was done.  If you specify a zero step > value, you'll have an infinite loop.  If you specify a negative > value, the loop variable will increment in the "wrong direction" > until intege