TRIGGER with WHEN clause - Mailing list pgsql-hackers

From Itagaki Takahiro
Subject TRIGGER with WHEN clause
Date
Msg-id 20091022111408.2F41.52131E4D@oss.ntt.co.jp
Whole thread Raw
Responses Re: TRIGGER with WHEN clause  (Itagaki Takahiro <itagaki.takahiro@oss.ntt.co.jp>)
List pgsql-hackers
Here is a patch to provide WHEN clause on triggers discussed here:
http://archives.postgresql.org/pgsql-hackers/2009-10/msg00869.php

Of course we can check conditions in the body of triggers, but
there are some benefits to have separate WHEN clause for SQL standard
compliance, portability, and saving AFTER trigger queues.

There might be still incomplete and debatable part in the patch:

  * Usages of TupleTableSlot and RangeTblEntry might be ugly.
    Please notice me if there are better ways.

  * There are no "retry" feature to evaluate condition when
    the NEW tuple is modifed by another trigger. Triggers are
    still executed in alphabetical order, but it is adjustable.

Comments welcome.

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

Attachment

pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Prelim specs for parser hooks for plpgsql
Next
From: Heikki Linnakangas
Date:
Subject: Re: Hot standby, prepared xacts, locks