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

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: Proposal: plpgsql - "for in array" statement
Дата
Msg-id 4CA2A3FC.3070505@dunslane.net
обсуждение исходный текст
Ответ на Re: Proposal: plpgsql - "for in array" statement  (Darren Duncan <darren@darrenduncan.net>)
Ответы Re: Proposal: plpgsql - "for in array" statement  (Darren Duncan <darren@darrenduncan.net>)
Список pgsql-hackers

On 09/28/2010 09:31 PM, Darren Duncan wrote:
> Alvaro Herrera wrote:
>> What about
>>
>> FOR EACH var IN array_expr LOOP ...
>>
>> I think this requires reserving EACH, which could cause a regression for
>> working code.  Maybe there's a way to make it work?
>
> Code that quotes all of its identifiers, such as with:
>
>   FOR EACH "var" IN "array_expr" LOOP ...
>
> ... would also gain a significant amount of future-proofing since then 
> the language can add keywords at will, without there being conflicts 
> with user-defined identifiers.
>
> Similarly, quoting identifiers also carries present-day advantages as 
> then one can name identifiers whatever is most suitably descriptive 
> for them without worrying whether the language has a pre-defined 
> meaning for the used words.
>
> The quoting also has the nice bonus of making them case-sensitive.
>
>

This doesn't help in the least if the array is an expression rather than 
simply a variable - we're not going to start quoting expressions.

cheers

andrew


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: [RRR] Commitfest: The Good, The Bad, and the Ugly
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: Proposal: plpgsql - "for in array" statement