sql - Trigger on view in Postgresql -
i have materialized view , view select * materialized view. want have trigger on view, executed after refreshing materialized view. tried after insert or update trigger, seems it's not working. possible in pgsql?
as easy example (in reality not have test table in same db ofc):
create table test(id integer primary key, sth integer); create materialized view test_mv select * test; create view test_mv_v select * test_mv; create or replace function test_trig() returns trigger $$ begin raise notice 'triggered'; return null;end;$$ language 'plpgsql'; create trigger test after insert or update on test_mv_v each statement execute procedure test_trig();
Comments
Post a Comment