J'ai ce déclencheur dans Postgresql que je ne peux pas simplement mettre au travail (ne fait rien). Pour comprendre, il y a la façon dont je l'ai définie:débogage postgresql trigger
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();
Maintenant, pour le rendre un peu plus intéressant .. Comment déboguer-vous déclencheurs?
Ce n'est pas strictement lié, mais vous pourriez trouver utile dans vos aventures pgsql de toute façon: http://stackoverflow.com/questions/430123/how-do-i-enable-the-postgresql-function -profiler – Kev