Re: Trigger firing order - Mailing list pgsql-general

From Tom Lane
Subject Re: Trigger firing order
Date
Msg-id 3318.975553238@sss.pgh.pa.us
Whole thread Raw
In response to Trigger firing order  ("Alex Bolenok" <abolen@chat.ru>)
List pgsql-general
"Alex Bolenok" <abolen@chat.ru> writes:
> peroon=# INSERT INTO t_foo (foo_value) VALUES (2000);
> NOTICE:  fn_foo_ains: Start
> NOTICE:  fn_foo_ains: End
> NOTICE:  fn_bar_ains: Start
> NOTICE:  fn_bar_ains: End

Looking at the code, it seems that all AFTER triggers are implicitly
handled as DEFERRED triggers, ie, they're queued up and executed at
end of statement.  This seems wrong to me --- DEFERRED mode is useful,
certainly, but it shouldn't be the only form of AFTER trigger.

Also, it'd seem to me that DEFERRED mode ought to mean defer till end
of transaction, not just end of statement...

Jan, any comments here?

            regards, tom lane

pgsql-general by date:

Previous
From: Larry Rosenman
Date:
Subject: Re: Bug? 'psql -l' in pg_ctl?
Next
From: "Wooi K."
Date:
Subject: calling plsql functions