Re: plpgsql FOR loop doesn't guard against strange step values - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: plpgsql FOR loop doesn't guard against strange step values
Date
Msg-id 200707142233.22579.peter_e@gmx.net
Whole thread Raw
In response to plpgsql FOR loop doesn't guard against strange step values  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: plpgsql FOR loop doesn't guard against strange step values  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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 integer overflow occurs.  Neither of these behaviors seem
> desirable in the least.

That seems to be fairly normal proramming language behavior.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: plpgsql FOR loop doesn't guard against strange step values
Next
From: Tom Lane
Date:
Subject: plpgsql and qualified variable names