I have a JSON entry like this, which I need to enter into a column (called values)
[\"Price Descending\",\"Price Ascending\",\"Name Ascending\",\"Date Descending
If value
is a json
column, you can convert the text representation of the array directly.
INSERT INTO tag_sets (type, value)
VALUES (
'sorting_options',
'["Price Descending","Price Ascending","Name Ascending","Date Descending"]'::json
);
You could also use a method to generate an array, depending on your situation.
Something like json_build_array
.
More json
methods can be found here.