1 CREATE LANGUAGE plpgsql;
2 CREATE FUNCTION log_insert_t1() RETURNS trigger AS $triggerinsertt1$
4 insert into csql_log_int (tablename, pkid, operation, cacheid) values ('t1', NEW.f1, 1, 1);
7 $triggerinsertt1$ LANGUAGE plpgsql;
9 create trigger triggerinsertt1
12 EXECUTE PROCEDURE log_insert_t1();
14 CREATE FUNCTION log_update_t1() RETURNS trigger AS $triggerupdatet1$
16 insert into csql_log_int (tablename, pkid, operation, cacheid) values ('t1', OLD.f1, 2, 1);
17 insert into csql_log_int (tablename, pkid, operation, cacheid) values ('t1', NEW.f1, 1, 1);
20 $triggerupdatet1$ LANGUAGE plpgsql;
22 create trigger triggerupdatet1
25 EXECUTE PROCEDURE log_update_t1();
27 CREATE FUNCTION log_delete_t1() RETURNS trigger AS $triggerdeletet1$
29 insert into csql_log_int (tablename, pkid, operation, cacheid) values ('t1', OLD.f1, 2, 1);
32 $triggerdeletet1$ LANGUAGE plpgsql;
34 create trigger triggerdeletet1
37 EXECUTE PROCEDURE log_delete_t1();