Re: Triggers on columns - Mailing list pgsql-hackers

From Itagaki Takahiro
Subject Re: Triggers on columns
Date
Msg-id 20090909091836.9C78.52131E4D@oss.ntt.co.jp
Whole thread Raw
In response to Re: Triggers on columns  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Responses Re: Triggers on columns
List pgsql-hackers
"Kevin Grittner" <Kevin.Grittner@wicourts.gov> wrote:

> How much does that buy you versus including this at the start of
> trigger_func:

One of the benefits is that it could handle tuple modifications
by another trigger, that is discussed here: http://archives.postgresql.org/pgsql-hackers/2009-09/msg00161.php | 2.
Recheckconditions if NEW values are modified, but triggers that |    have been fired already are not executed twice.
 

In addition, some database developers think procedures of trigger
and its condition separately. They might use other DBMSs that supports
WHEN clause in other times [1][2][3]. (All of them use "WHEN" for the
syntax; that's why I proposed "WHEN" but not "WHERE".)

Also, it would be useful if we reuse trigger bodies multiple times
with different conditions.

[1] Oracle   http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/create_trigger.htm
[2] IBM DB2
http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=/com.ibm.db2.udb.admin.doc/doc/r0000931.htm
[3] SQLite3   http://www.sqlite.org/lang_createtrigger.html

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center




pgsql-hackers by date:

Previous
From: Itagaki Takahiro
Date:
Subject: Re: CREATE LIKE INCLUDING COMMENTS and STORAGES
Next
From: Robert Haas
Date:
Subject: Re: LATERAL