Re: TRIGGER with WHEN clause - Mailing list pgsql-hackers

From Itagaki Takahiro
Subject Re: TRIGGER with WHEN clause
Date
Msg-id 20091124094257.B04E.52131E4D@oss.ntt.co.jp
Whole thread Raw
In response to Re: TRIGGER with WHEN clause  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> wrote:

> > [ TRIGGER WHEN patch ]
> Applied with assorted revisions.  AFAICT the system column issue is only
> a problem for NEW references in BEFORE triggers --- those columns do
> read correctly in OLD, and all the time in AFTER triggers.  I revised
> the parsing logic to enforce that.  The patch also missed establishing
> dependencies for stuff referenced in the WHEN expression, and there were
> a few other minor problems.

Thanks for your fix.

>> * Keep the expression in nodeToString string form within the TriggerDesc
>> structure; then it's just one more pfree in FreeTriggerDesc.  The main
>> disadvantage of this is that we'd have to repeat stringToNode every time
>> the trigger is used.

I read your fix for the repeated compiling issue is to cache compiled
expressions in ResultRelInfo->ri_TrigWhenExprs. So, we can reuse the
result of stringToNode when we modify multiple rows in a query.

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




pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Re: [GENERAL] Updating column on row update
Next
From: Itagaki Takahiro
Date:
Subject: Re: Hot standby and removing VACUUM FULL