1 create or replace function site_aggregates_site()
2 returns trigger language plpgsql
5 IF (TG_OP = 'INSERT') THEN
6 insert into site_aggregates (site_id) values (NEW.id);
7 ELSIF (TG_OP = 'DELETE') THEN
8 delete from site_aggregates where site_id = OLD.id;