scientific_entertainment, atristic_entertainment, technical_entertainment, entertainment, sport_entertainment)
values (?, ?, ?, ?, ?, ?)
returning row_to_json(entertainment.*);
I have table that fields type is jsonb and when I try to save empty json it's ok but when I try insert something like this ["test1", "test2", "test3"] into it I got this error :
insert into entertainment(user_id, scientific_entertainment, atristic_entertainment, technical_entertainment, entertainment, sport_entertainment)
values (8, ["test1", "test2", "test3"], ["test1", "test2", "test3"], ["test1", "test2", "test3"], ["test1", "test2", "test3"], ["test1", "test2", "test3"])
returning row_to_json(entertainment.*)
[2020-03-26 20:16:08] [42601] ERROR: syntax error at or near "["
[2020-03-26 20:16:08] Position: 170
what is wrong in this query?
enclose your data with `and try again...
Обсуждают сегодня