Re: trigger, how to determine action calling?

From: Yury Don <yura(at)vpcit(dot)ru>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: trigger, how to determine action calling?
Date: 2000-08-31 08:55:05
Message-ID: 10412262090.20000831145505@vpcit.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)vpcit(dot)ru

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jules Bean 2000-08-31 08:58:34 Re: Large selects handled inefficiently?
Previous Message Marcin Mazurek 2000-08-31 08:22:10 trigger, how to determine action calling?