Re: Proposal: plpgsql - "for in array" statement

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Proposal: plpgsql - "for in array" statement
Дата
Msg-id 28428.1285705970@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Proposal: plpgsql - "for in array" statement  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: Proposal: plpgsql - "for in array" statement  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
Pavel Stehule <pavel.stehule@gmail.com> writes:
> 2010/9/28 Tom Lane <tgl@sss.pgh.pa.us>:
>> As an example, is this a for-in-query or a
>> for-in-array?
>> 
>>        FOR v IN (SELECT arraycol FROM tab) LOOP ...

> This is a subquery - so it is a for-in-array - should return one row
> with one column.

That's not obvious at all.  It's legal right now to write that, and it
will be interpreted as for-in-query.  Furthermore, there are cases where
it's essential to be able to write a left paren before SELECT, so that
you can control the precedence of UNION/INTERSECT/EXCEPT constructs.
So you're proposing to remove functionality and break existing code in
order to have a "simple" syntax for for-in-array.
        regards, tom lane


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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: Proposal: plpgsql - "for in array" statement
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Proposal: plpgsql - "for in array" statement