string to json in postgresql code example
Example 1: json array to string in postgresql
SELECT
ID
,(
SELECT string_agg(trim(JsonString::text, '"'), ', ')
FROM jsonb_array_elements(JsonData->'Name') JsonString
) AS StringArray
FROM tbl_TestJsonArray;
Example 2: postgres json
UPDATE users SET data = jsonb_set(data, '{name}', '"John"');