I need to update a jsonb column which contains data {"X":true}.
I need to append a complex object of the type {"obj":{"a":1,"b":2}} so the final value of row for that column {"x":true,"obj":{"a":1,"b":2}} . What will be the query to update this row .
postgres version 12
Update - The following query update tableName set columnName = (select '{"obj":{"a":1,"b":2}}'::jsonb || columnName::jsonb) where ... returns successfully when there is a value present , but when the column is null it still remains null after running the update query . I need to be able to add {"obj":{"a":1,"b":2}} even when the column is null .