0

I'm trying to convert a string that is a JSON-style array into a PostgreSQL array and have not been able to find the syntax I need to do it.

My string looks like this:

'["Team","Stretch","Regional"]'

I know I can do this by replacing the [ and ] with { and } and using ::text[], but I feel like there has to be a better, cleaner way to do this. I've tried multiple JSON manipulation functions and so far haven't had any luck as most of them are designed to work in the context of an object. I'm using Postgres 14.x, for the record.

0 Answers0