Search Postgresql Archives

How to explode an array into multiple rows

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

              http://archives.postgresql.org

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux