From ede54f3cd789b9bdd910de6a632730e1c2e112bc Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Fri, 9 Dec 2005 19:39:41 +0000 Subject: [PATCH] Add documentation about the behavior of BEFORE triggers and referential integrity actions. Stephan Szabo --- doc/src/sgml/ref/create_trigger.sgml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/doc/src/sgml/ref/create_trigger.sgml b/doc/src/sgml/ref/create_trigger.sgml index cbf51f8b86..403ad85638 100644 --- a/doc/src/sgml/ref/create_trigger.sgml +++ b/doc/src/sgml/ref/create_trigger.sgml @@ -1,5 +1,5 @@ @@ -241,13 +241,25 @@ CREATE TRIGGER name { BEFORE | AFTE function that executes the desired commands. + SQL specifies that multiple triggers should be fired in time-of-creation order. PostgreSQL uses - name order, which was judged more convenient to work with. + name order, which was judged to be more convenient. + + + + SQL specifies that BEFORE DELETE triggers on cascaded + deletes fire after the cascaded DELETE completes. + The PostgreSQL behavior is for BEFORE + DELETE to always fire before the delete action, even a cascading + one. This is considered more consistent. There is also unpredictable + behavior when BEFORE triggers modify rows that are later + to be modified by referential actions. This can lead to contraint violations + or stored data that does not honor the referential constraint. -- 2.40.0