Re: Firing Orders
От | Stephan Szabo |
---|---|
Тема | Re: Firing Orders |
Дата | |
Msg-id | 20021128100317.C7870-100000@megazone23.bigpanda.com обсуждение исходный текст |
Ответ на | Firing Orders ("CN" <cnliou9@fastmail.fm>) |
Список | pgsql-general |
On Thu, 28 Nov 2002, CN wrote: > "If more than one trigger is defined for the same event on the same > relation, the triggers will be fired in alphabetical order by name." I think event in this case probably is meant to include the BEFORE/AFTER state. > Q1. Are BEFORE UPDATE and BEFORE DELETE (let's call them as "customed") > triggers always fired before RI_ConstraintTriggers on the same relation > regardless of the alphabetical name of these customed triggers? Yes, because before triggers happen at a different stage of the processing. > > Q3. Are AFTER UPDATE and AFTER DELETE (customed) triggers fired after > RI_ConstraintTriggers on the same relation regardless of the alphabetical > name of these customed triggers? No it's in alpha order. I believe technically this isn't compliant by SQL99 14.14/14.20, but it may be more useful. ;) > Q2. Are BEFORE UPDATE and BEFORE DELETE (customed) triggers on the > referenced relation fired before the RI_ConstraintTriggers on the > referencing relation regardless of the alphabetical name of these > customed triggers? > Q4. Are AFTER UPDATE and AFTER DELETE (customed) triggers on the > referenced relation fired after the RI_constraintTriggers on the > referencing relation regardless of the alphabetical name of these > customed triggers? I don't get it. Since the referencing constraint triggers do only selects, the referenced relation shouldn't be firing triggers. If you meant the other directly. If you meant the other direction when there's an action being done, I think it basically goes: Before triggers on referenced Action on referenced (update/delete) After triggers on referenced before RI trigger - Before triggers on referencing - Action on referencing After triggers on referenced after RI After triggers on referencing (which may also have RI)
В списке pgsql-general по дате отправления: