How to unnest nested arrays

Поиск
Список
Период
Сортировка
От Guyren Howe
Тема How to unnest nested arrays
Дата
Msg-id 9BFD1A82-0B06-4B57-A5F4-8525E122B12B@gmail.com
обсуждение исходный текст
Ответы Re: How to unnest nested arrays
Список pgsql-general
Consider this:

select (array[array[1, 2], array[3, 4]])[i:i]
from generate_subscripts(array[array[1, 2], array[3, 4]], 1) i

which produces:

{{1,2}}
{{3,4}}

I expect and want, from that source:

{1, 2}
{3, 4}

These don’t work:

select (array[array[1, 2], array[3, 4]])[i:i][:]
{{1,2}}
{{3,4}}

select (array[array[1, 2], array[3, 4]])[i:i][1:1]
{{1}}
{{3}}


Also: could we _please_ get a version of unnest that doesn’t explode any number of dimensions into 1?

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

Предыдущее
От: Devrim Gündüz
Дата:
Сообщение: Re: Cstore_fdw issue.
Следующее
От: AC Gomez
Дата:
Сообщение: extract property value from set of json arrays