Re: Different handling of PL/pgSQL for-loop variables in 8.3.7 vs. 8.2.7 ???

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: depesz(at)depesz(dot)com
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Atul Chojar <achojar(at)airfacts(dot)com>, pgsql-general(at)postgresql(dot)org, Li <lilian(dot)ying(at)airfacts(dot)com>, Andy Yoder <ayoder(at)airfacts(dot)com>
Subject: Re: Different handling of PL/pgSQL for-loop variables in 8.3.7 vs. 8.2.7 ???
Date: 2009-06-11 10:45:56
Message-ID: 162867790906110345h7cf2c620qff02198434fbe08a@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

2009/6/11 hubert depesz lubaczewski <depesz(at)depesz(dot)com>:
> On Wed, Jun 10, 2009 at 04:51:44PM -0400, Tom Lane wrote:
>> It's the new implementation.  Depending on unspecified implementation
>> details is a good way to have broken code.
>
> i'm not sure if it's good change. there might be perfectly good reasons
> to increment idx from within loop.
>

generally - modification of cycle's control variable isn't good
technique, because it's should be broken by some optimizations. When
you would to modify this some variables, then use "while-loop"
instead.

regards
Pavel Stehule

> Best regards,
>
> depesz
>
> --
> Linkedin: http://www.linkedin.com/in/depesz  /  blog: http://www.depesz.com/
> jid/gtalk: depesz(at)depesz(dot)com / aim:depeszhdl / skype:depesz_hdl / gg:6749007
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message hubert depesz lubaczewski 2009-06-11 11:00:17 Re: Different handling of PL/pgSQL for-loop variables in 8.3.7 vs. 8.2.7 ???
Previous Message hubert depesz lubaczewski 2009-06-11 10:24:41 Re: Different handling of PL/pgSQL for-loop variables in 8.3.7 vs. 8.2.7 ???

Browse pgsql-general by date

  From Date Subject
Next Message hubert depesz lubaczewski 2009-06-11 11:00:17 Re: Different handling of PL/pgSQL for-loop variables in 8.3.7 vs. 8.2.7 ???
Previous Message David 2009-06-11 10:38:49 Re: When to use cascading deletes?