Re: deferrable triggers
От | Tom Lane |
---|---|
Тема | Re: deferrable triggers |
Дата | |
Msg-id | 20865.1324427175@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: deferrable triggers ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>) |
Ответы |
Re: deferrable triggers
|
Список | pgsql-hackers |
"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes: > Tom Lane <tgl@sss.pgh.pa.us> wrote: >> What do you mean by "hand-written DEFERRABLE trigger"? > Ah, I had forgotten that I had to use the CONSTRAINT keyword in the > trigger definition; the sentence in the docs makes more sense now. > I wrote a plpgsql trigger function and created a deferrable > initially deferred constraint trigger which referenced it. Is that > a reasonable thing to do if you need a commit-time trigger based on > some particular action against a particular table? Would it be a > reasonable way for the person on irc to enforce the business rule > mentioned above? Sure. The reason we decided to document CREATE CONSTRAINT TRIGGER was exactly that people sometimes need to use it for things besides foreign keys. However, it's not a "commit time" trigger exactly -- keep in mind that SET CONSTRAINTS can override the trigger's own timing specification. regards, tom lane
В списке pgsql-hackers по дате отправления: