Re: trigger, how to determine action calling? - Mailing list pgsql-general

From Yury Don
Subject Re: trigger, how to determine action calling?
Date
Msg-id 10412262090.20000831145505@vpcit.ru
Whole thread Raw
In response to trigger, how to determine action calling?  (Marcin Mazurek <M.Mazurek@poznan.multinet.pl>)
List pgsql-general
Hello Marcin,

Once, Thursday, August 31, 2000, 2:22:10 PM, you wrote:

MM> Hi,
MM> Is it possible to determine easily which action called triger?
MM> For example:
MM> CREATE TRIGGER log_znw BEFORE INSERT OR UPDATE ON tab
MM>    FOR EACH ROW EXECUTE PROCEDURE log_tab();
MM> How to check in called function if it was INSERT or UPDATE?

If you use plpgsql language for your procedure, then TG_OP variable is
what you need, if pltcl, then $TG_op variable.

--
Best regards,
 Yury  ICQ 11831432
 mailto:yura@vpcit.ru



pgsql-general by date:

Previous
From: Marcin Mazurek
Date:
Subject: trigger, how to determine action calling?
Next
From: Jules Bean
Date:
Subject: Re: Large selects handled inefficiently?