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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: proposal: FOREACH-IN-ARRAY (probably for 9.2?)
Дата
Msg-id 2016.1292606810@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: proposal: FOREACH-IN-ARRAY (probably for 9.2?)  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-hackers
Merlin Moncure <mmoncure@gmail.com> writes:
> On Fri, Dec 17, 2010 at 12:15 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> [ scratches head... ] �I don't follow what you envision this doing,
>> exactly?

> It's like _pg_expandarray but alterted support multiple dimensions:

> select * from unnest_dims(array[['a','b'],['c','d']]) returns
> [1,1], 'a'
> [1,2], 'b'
> [2,1], 'c'
> [2,2], 'd'

Oh, so that's an *output* not an input.  And IIUC what you are returning
is the subscripts associated with the current element, not the array's
dimensions.  Seems like it should go beside the normal target variable
then, not at the end.
FOREACH variable_for_value [, variable_for_subscripts ] IN ARRAY ...
        regards, tom lane


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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: proposal: FOREACH-IN-ARRAY (probably for 9.2?)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: proposal: FOREACH-IN-ARRAY (probably for 9.2?)