Re: Improving CREATE CONSTRAINT TRIGGER documentation - trigger firing order

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Improving CREATE CONSTRAINT TRIGGER documentation - trigger firing order
Дата
Msg-id 24565.1177172440@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Improving CREATE CONSTRAINT TRIGGER documentation - trigger firing order  (Michael Glaesemann <grzm@seespotcode.net>)
Ответы Re: Improving CREATE CONSTRAINT TRIGGER documentation - trigger firing order  (David Pufer <david.pufer@7data.eu>)
Список pgsql-docs
Michael Glaesemann <grzm@seespotcode.net> writes:
> On Apr 21, 2007, at 4:39 , David Pufer wrote:
>> In my opinion it would be nice to mention in SQL reference commands that
>> constraint triggers created by CREATE CONSTRAINT TRIGGER are fired in
>> creation order unlike regular triggers created by command CREATE
>> TRIGGER. As I know, the firing order of the CONSTRAINT TRIGGER is
>> determined by the XXXXX num at "RI_ConstraintTrigger_XXXXX" column in
>> pg_trigger table.

> I believe this just falls out of the normal order of trigger firing
> as explained in the CREATE TRIGGER documentation (http://
> www.postgresql.org/docs/8.2/interactive/sql-createtrigger.html)

The proposed change is wrong anyway: AFAICS from looking at the code,
an RI_ConstraintTrigger_XXXXX name is only generated for triggers that
are created in support of FOREIGN KEY constraint syntax.  If you use
CREATE CONSTRAINT TRIGGER then the trigger name is whatever you say it
is.  I don't recall if it was always like that, but that's definitely
the behavior in CVS HEAD.

It would be a mistake to assume that FK constraint triggers are fired in
creation order anyway, since the lexical sorting of strings isn't the
same as numeric order (not to mention OID wraparound issues).

            regards, tom lane

В списке pgsql-docs по дате отправления:

Предыдущее
От: David Pufer
Дата:
Сообщение: Re: Improving CREATE CONSTRAINT TRIGGER documentation - trigger firing order
Следующее
От: David Pufer
Дата:
Сообщение: Re: Improving CREATE CONSTRAINT TRIGGER documentation - trigger firing order