db=# CREATE FUNCTION schma.tbl_ins_upd() RETURNS TRIGGER AS 'BEGIN EXECUTE public.mc_init(); EXECUTE public.mc_delete(''mc_key''); RETURN NEW; END;' LANGUAGE 'plpgsql'; db=# CREATE FUNCTION schma.tbl_del() RETURNS TRIGGER AS 'BEGIN EXECUTE public.mc_init(); EXECUTE public.mc_delete(''mc_key''); RETURN OLD; END;' LANGUAGE 'plpgsql';
could this be used?
CREATE FUNCTION schma.tbl_ins_upd() RETURNS TRIGGER AS 'BEGIN
EXECUTE public.mc_init();
EXECUTE public.mc_delete(''mc_key'');
if TG_OP = ''INSERT'' or TG_OP = ''UPDATE'' then
RETURN NEW;
else
RETURN OLD;
end if; END;' LANGUAGE 'plpgsql';
regards
Laser
---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives?
http://archives.postgresql.org