postgresql json array code example
Example 1: postgres json
UPDATE users SET data = jsonb_set(data, '{name}', '"John"');
Example 2: postgresql parse json array
SELECT array_to_json(array_col) as array_col FROM t_name;
Example 3: json with postgresql
SELECT info ->> 'customer' AS customer,
info -> 'items' ->> 'product' AS product
FROM orders
WHERE CAST ( info -> 'items' ->> 'qty' AS INTEGER) = 2