I have been struggling in how to insert into a table in PG that has a JSON column... I am extracting a bit column from another table, and now I want to insert that bit to the json column, for example:
INSERT INTO TABLE (JSON) VALUES( '{"IsAllowed":"' || is_allowed::TEXT || '"}'::JSON )
is_allowed represents to the bit from another table... And I get:
"column "XXX" is of type json but expression is of type text"
Does anyone know how can I achieve this?
Thanks!