Re: Triggers on columns - Mailing list pgsql-hackers

From Itagaki Takahiro
Subject Re: Triggers on columns
Date
Msg-id 20090907110957.C84F.52131E4D@oss.ntt.co.jp
Whole thread Raw
In response to Re: Triggers on columns  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: Triggers on columns
List pgsql-hackers
Here is a updated version of column-trigger patch.

Changes from the previous patch:
  * Add dependency of columns with recordDependencyOn().
    Regression tests are also adjusted.
  * Recheck columns if NEW values are modified, but each trigger
    will be firec only one per row.


Peter Eisentraut <peter_e@gmx.net> wrote:
> The SQL standard specifies that a trigger is fired if the column is
> mentioned in the UPDATE statement, independent of whether the value is
> actually changed through the update.

We are discussing how to determine modified columns
(UPDATE-target vs. changes of actual values), but in the patch
I used value-based checking. The reasons are:
    1. Other triggers could modify referred columns even if the columns
       are not specifed in UPDATE-target.
    2. IMHO, almost users don't expect their triggers are not called
       if the actual values are not modified.
    3. Restriction of implementation; We don't have RTE in trigger
       routine for now. The current patch doesn't modify codes a lot.

Comments welcome.

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


Attachment

pgsql-hackers by date:

Previous
From: KaiGai Kohei
Date:
Subject: Re: [PATCH] Largeobject access controls
Next
From: Itagaki Takahiro
Date:
Subject: _WIN32_WINNT should be 0x0501 in win32.h