drop view v1;
drop table tab1;

create table tab1 (f1 int, id serial);

insert into tab1 values (42);

table tab1;

create view v1 as select f1, id from tab1;

create rule r1 as on update to v1 do instead
update tab1 set f1 = new.f1 where tab1.id = new.id;

update v1 set f1 = 11;

table tab1;

alter table tab1 add column f2 int generated always as (f1 * 2) stored;

table tab1;

update v1 set f1 = 12;

table tab1;
