DROP TABLE t_xyz;

CREATE TABLE t_xyz (id integer, deleted boolean);

insert into t_xyz (id, deleted) values (1, false);
insert into t_xyz (id, deleted) values (2, false);

CREATE RULE r_del_xyz
AS ON DELETE TO t_xyz WHERE (deleted = false)
DO INSTEAD
  UPDATE t_xyz
  SET deleted = true;

SELECT * FROM t_xyz;

DELETE FROM t_xyz WHERE id = 1;

SELECT * FROM t_xyz;

