Postgres json to String
SELECT CAST( json_column AS TEXT ) FROM table
or
SELECT json_column::TEXT FROM table
Colorful Constrictor
SELECT CAST( json_column AS TEXT ) FROM table
or
SELECT json_column::TEXT FROM table
SELECT string_agg(trim(tdata::text, '"'), ', ') from jsonb_array_elements(CAST('[1 , 2]' as jsonb)) tdata
SELECT
ID
,(
SELECT string_agg(trim(JsonString::text, '"'), ', ')
FROM jsonb_array_elements(JsonData->'Name') JsonString
) AS StringArray
FROM tbl_TestJsonArray;
SELECT info ->> 'customer' AS customer,
info -> 'items' ->> 'product' AS product
FROM orders
WHERE CAST ( info -> 'items' ->> 'qty' AS INTEGER) = 2