Re: trigger not firing
От | Stephan Szabo |
---|---|
Тема | Re: trigger not firing |
Дата | |
Msg-id | 20070225191808.N40408@megazone.bigpanda.com обсуждение исходный текст |
Ответ на | trigger not firing (joseph speigle <joesp@sirfsup.com>) |
Ответы |
Re: trigger not firing
|
Список | pgsql-novice |
On Mon, 26 Feb 2007, joseph speigle wrote: > > hello novice list, > can somebody show me where my mistake is with this trigger. > everything is fine, but they don't fire...... > > [postgres@www ~]$ pg_ctl --version > pg_ctl (PostgreSQL) 8.1.3 > [postgres@www ~]$ > > --------------------------------------------------------------------- > drop function qp_question_moddate() cascade ; > > CREATE FUNCTION qp_question_moddate() RETURNS OPAQUE > AS ' > BEGIN > > NEW.moddate := current_date; > RETURN NEW; > END; > ' LANGUAGE 'plpgsql'; > > create trigger qp_question_moddate_update after update on qp_question > for each row execute procedure qp_question_moddate(); After triggers are too late for modifying NEW (since the record is already created or changed), you'd need to make it a before trigger.
В списке pgsql-novice по дате отправления: