postgres json to string
snippet in sql

json array to string in postgresql

user3724

SELECT 
	ID
	,(
		SELECT string_agg(trim(JsonString::text, '"'), ', ')
		FROM jsonb_array_elements(JsonData->'Name') JsonString
	) AS StringArray
FROM   tbl_TestJsonArray;

postgres json to string

user1353

SELECT CAST( json_column AS TEXT ) FROM table
or
SELECT json_column::TEXT FROM table

json with postgresql

user3271


        
            
        
     SELECT info ->> 'customer' AS customer,
	info -> 'items' ->> 'product' AS product
FROM orders
WHERE CAST ( info -> 'items' ->> 'qty' AS INTEGER) = 2