Re: proposal: FOREACH-IN-ARRAY (probably for 9.2?)

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: proposal: FOREACH-IN-ARRAY (probably for 9.2?)
Дата
Msg-id AANLkTikw-S3EQDZ-RyJwZyQ1VC92+Ba42eWECr9RFQhZ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: proposal: FOREACH-IN-ARRAY (probably for 9.2?)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
2010/12/17 Tom Lane <tgl@sss.pgh.pa.us>:
> Pavel Stehule <pavel.stehule@gmail.com> writes:
>> I am resending a redesigned proposal about special plpgsql statement
>> that support iteration over an array.
>
> OK ...
>
>> == Iteration over multidimensional arrays ==
>> Its designed to reduce one dimension from source array. It can remove
>> a slicing and simplify code:
>
> This seems like a really bad, confusing idea.  I think it should throw
> a type-mismatch error in this case.  If there is any use-case for such a
> thing, which I'm quite unconvinced of, it ought to use a separate syntax
> rather than overloading the element-by-element syntax.

Without this feature any iteration over 2d and more dimensional array
is not practical. If I have a 2D array, then I would to get a vector.
Access to individual values can be to limiting, because I need a more
cycles to get a complete vector. Usually I can use a array of row
instead a 2d array, but still and in feature there is problem with
iteration over row. So sometime is more practical to use a 2d array.

Actually It raise a type mismatch error, when a user used a scalar
variable and data is a vector (array)

Pavel


>
>                        regards, tom lane
>


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

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: proposal: FOREACH-IN-ARRAY (probably for 9.2?)
Следующее
От: Robert Haas
Дата:
Сообщение: Re: bug in SignalSomeChildren