Re: check source of trigger

From: Richard Huxton <dev(at)archonet(dot)com>
To: "wit" <microx(at)hotpop(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: check source of trigger
Date: 2002-09-20 09:23:43
Message-ID: 200209201023.43571.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Friday 20 Sep 2002 9:25 am, wit wrote:

> I have trigger and procedure on table B to capture any change and insert
> into table logB:
> create trigger trigger_b before insert or update or delete on B for
> each row execute procedure log_change();
>
> When I update e_codeA in table A, the constrain trigger will update e_codeA
> in B. My trigger, trigger_b, also was trigged and procedure will record
> change into table logB too.
> How to write a code in my db procedure to check whether the procedure was
> called by normal SQL or was called by cascade trigger.

There are a number of "special" variables defined if you are a trigger
procedure (not just OLD and NEW) - is that what you were after (Programmers
manual, ch 23.9)

- Richard Huxton

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Huxton 2002-09-20 10:35:59 Re:
Previous Message Seb 2002-09-20 08:54:55 Date/Time types