Convert an array into a table, and vice versa - postgresql's array and unnest

Let's say you have the array named arr: '{"one", "two"}'.

select unnest(arr) as my_column_name;

will turn it into a table. And if you pass select array() a table, it'll turn it into an array.

postgresql

Edit on github
comments powered by Disqus
Click me