Convert a json array into a postgresql text array

We use json_array_elements_text, or its jsonb equivalent, to get the elements as a text table.

And put that into a select array() statement.

select array(
  select jsonb_array_elements_text('["hi", "there"]')
);
postgresql

Edit on github
comments powered by Disqus
Click me