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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Proposal: plpgsql - "for in array" statement
Дата
Msg-id 28950.1285707807@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>:
>> Sure it can: it could be a parenthesized top-level query.  In fact,
>> that's what plpgsql will assume if you feed it that syntax today.

> no - there are not any legal construct FOR r IN (..)

You are simply wrong, sir, and I suggest that you go read the SQL
standard until you realize that.  Consider for example
for r in (SELECT ... FROM a UNION SELECT ... FROM b) INTERSECT (SELECT ... FROM c) LOOP ...

The parentheses here are not merely legal, they are *necessary*, else
the semantics of the UNION/INTERSECT operations change.
        regards, tom lane


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

Предыдущее
От: David Fetter
Дата:
Сообщение: Commitfest: The Good, The Bad, and the Ugly
Следующее
От: Sergey Burladyan
Дата:
Сообщение: UTF8 regexp and char classes still does not work