Postgres Triggers instead of requiring a field - fire when field not included

From: Kevin Traster <ktraster(at)freshgrillfoods(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Postgres Triggers instead of requiring a field - fire when field not included
Date: 2011-05-24 18:48:36
Message-ID: BANLkTinSZF=+jpT-E+4VCtKd0Osy4_9ZMQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

In Postgres 9.0, trying to prevent a recursive trigger by adding a column
"notrigger".

Psuedo code: create trigger before_update_holdings_table BEFORE UPDATE ON
holdings FOR EACH ROW when (new.notrigger is not given) EXECUTE PROCEDURE
before_update_holdings();

I see in the docs, I can do the opposite - have it fire only when a field is
included.

1) Is there any way to do the above, have a trigger fire when a field is not
specifically included?
2) If not, what is the easiest way to prevent recursive triggers (in the
update trigger, other update are done to the table and the trigger should be
ignored).

Thanks,

Browse pgsql-general by date

  From Date Subject
Next Message Greg Smith 2011-05-24 18:48:52 Re: [PERFORMANCE] expanding to SAN: which portion best to move
Previous Message Robert Haas 2011-05-24 18:12:00 Re: [HACKERS] Error compiling sepgsql in PG9.1