json field postgres code example
Example 1: postgres json to string
SELECT CAST( json_column AS TEXT ) FROM table
or
SELECT json_column::TEXT FROM table
Example 2: postgres json
UPDATE users SET data = jsonb_set(data, '{name}', '"John"');
SELECT CAST( json_column AS TEXT ) FROM table
or
SELECT json_column::TEXT FROM table
UPDATE users SET data = jsonb_set(data, '{name}', '"John"');