Check out example codes for "json with postgresql". It will help you in understanding the concepts better.

Code Example 1

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

Code Example 2

SELECT string_agg(trim(tdata::text, '"'), ', ') from jsonb_array_elements(CAST('[1 , 2]' as jsonb)) tdata

Code Example 3

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

Learn ReactJs, React Native from akashmittal.com