I have a table xyz that has a jsob column called metadata, which looks something like
"{"decisions": {"final_decision": "ADVANCE"}, "exception": {} }".
I want to remove the 'exception' attribute and have an sql
update xyz set metadata = metadata - metadata->'exception' where process_id='1e3aeac3';
But this gives me an exception while running
ERROR: operator does not exist: jsonb - jsonb
LINE 1: update xyz set metadata= metadata - 'exception'...
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
I tried searching but I wasn't able to get around the cast issue.