Re: TRIGGER with WHEN clause

From: Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>, KaiGai Kohei <kaigai(at)kaigai(dot)gr(dot)jp>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: TRIGGER with WHEN clause
Date: 2009-11-24 00:42:57
Message-ID: 20091124094257.B04E.52131E4D@oss.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-rrreviewers


Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Itagaki Takahiro 2009-11-24 00:55:24 Re: Hot standby and removing VACUUM FULL
Previous Message Craig Ringer 2009-11-24 00:36:30 Re: [HACKERS] Updating column on row update

Browse pgsql-rrreviewers by date

  From Date Subject
Next Message Bernd Helmle 2009-11-24 10:52:06 Re: CommitFest 2009-11: One week update
Previous Message Joshua Tolley 2009-11-23 21:38:10 Re: CommitFest 2009-11: One week update