I want to insert JSON with the value of the array from postgrsql to value into JSON-type columns. What should I do?
CREATE TABLE jsonlist (col JSON);
INSERT INTO jsonlist(col)
VALUES ('{"usrGrp":"{1,2,3}"}');
I got it:
'{"action":"del","usrId": ["yjshin","test111"],"usrGrpId": [1,2]}'
You can use brackets to tie up what you want to make a list. Note that in the array, the string had to enclose each element in double quotes, and the entire JSON had to be enclosed in single quotes.
[1,2,3]