How to explode an array into multiple rows

Поиск
Список
Период
Сортировка
От Kevin Murphy
Тема How to explode an array into multiple rows
Дата
Msg-id 42EFD8E4.5060205@speakeasy.net
обсуждение исходный текст
Ответы Re: How to explode an array into multiple rows  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
I'd like to do something like this:

select array_explode(array_col) from table1 where col2 = 'something';

where array_explode returns the elements of array_col unpacked onto
separate rows.

I tried creating a function returning a setof type, but postgresql
produces a "set-valued function called in context that cannot accept a
set" error.  I've seen this error in the list archives, but I'm not sure
how to translate the simple cases discussed into this situation.  I'm
sure it's something simple, but it's been eluding me.

Thanks,
Kevin Murphy


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

Предыдущее
От: "silasju@gmail.com"
Дата:
Сообщение: Problems to install pg 8.0.3
Следующее
От: Jon
Дата:
Сообщение: Going beyond sql