create table tab1 (id int);
create table tab2 (id int);
create rule tab1_insert as on insert to tab1 do instead insert into tab2 values (new.id);

insert into tab1 values (100);
select * from tab2;

drop rule tab1_insert on tab1;
create rule tab1_insert as on insert to tab1 where 1<2 do instead insert into tab2 values (new.id);

delete from tab2;
select * from tab2;

insert into tab1 values (100);
select * from tab2;

drop rule tab1_insert on tab1;
drop table tab2;
drop table tab1;

