我在Postgresql中有这个触发器,我不能只是开始工作(什么都不做)。为了理解,我是这样定义它的:调试postgresql触发器
CREATE TABLE documents (
...
modification_time timestamp with time zone DEFAULT now()
);
CREATE FUNCTION documents_update_mod_time() RETURNS trigger
AS $$
begin
new.modification_time := now();
return new;
end
$$
LANGUAGE plpgsql;
CREATE TRIGGER documents_modification_time
BEFORE INSERT OR UPDATE ON documents
FOR EACH ROW
EXECUTE PROCEDURE documents_update_mod_time();
现在让它更有趣一点..如何调试触发器?
这是不严格相关,但你可能会发现它在你的pgsql冒险有用反正:http://stackoverflow.com/questions/430123/how-do-i-enable-the-postgresql-function -profiler – Kev 2009-01-09 23:34:18