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

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: Different handling of PL/pgSQL for-loop variables in 8.3.7 vs. 8.2.7 ???
Дата
Msg-id 162867790906110517m221cc714w4abc61167ab23e8e@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Different handling of PL/pgSQL for-loop variables in 8.3.7 vs. 8.2.7 ???  (hubert depesz lubaczewski <depesz@depesz.com>)
Список pgsql-general
2009/6/11 hubert depesz lubaczewski <depesz@depesz.com>:
> On Thu, Jun 11, 2009 at 12:45:56PM +0200, Pavel Stehule wrote:
>> generally - modification of cycle's control variable isn't good
>> technique, because it's should be broken by some optimizations. When
>
> i would argue then that these optimizations are broken, then.
>
>> you would to modify this some variables, then use "while-loop"
>> instead.
>
> while technically possible, i find for loops much more straight forward,
> and clearer to understand.
>

sure, forloop is clean, but not when you do some alchemy with control
variables. When you need increase step, then use BY clause. But I
thing, so it's easy protect users by marking control variables as read
only variable.

regards
Pavel Stehule

> Best regards,
>
> depesz
>
> --
> Linkedin: http://www.linkedin.com/in/depesz  /  blog: http://www.depesz.com/
> jid/gtalk: depesz@depesz.com / aim:depeszhdl / skype:depesz_hdl / gg:6749007
>

В списке pgsql-general по дате отправления:

Предыдущее
От: Brett Henderson
Дата:
Сообщение: Re: queries on xmin
Следующее
От: Greg Stark
Дата:
Сообщение: Re: queries on xmin