0
I have a json (not jsonb) column in a PostgreSQL (version 13.12) table from which I want to remove specific values of an array attribute.
For example, in the following table (db-fiddle) I want to remove all occurrences of “D” from the actions attributes.
DROP TABLE IF EXISTS test;
CREATE TABLE test (
data JSON
);
INSERT INTO test VALUES
(’{“name”: “Alice”, “actions”: [“B”, “C”, “D”]}’),
(’{“name”: “Charles”, “actions”: [“C”, “D”, “E”]}’);
SELECT * FROM test;
How can I do this with a query?