Re: Trigger with conditional predicates - Mailing list pgsql-general

From Dirk Mika
Subject Re: Trigger with conditional predicates
Date
Msg-id 9CB1A2F2-1B40-4B14-AF71-8DC129B806A0@mikatiming.de
Whole thread Raw
In response to Re: Trigger with conditional predicates  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
> > PostgreSQL doesn't have an exact equivalent.  Typically, the OLD and NEW values are compared and then action is
takenbased on that.  For example, in PL/pgSQL:
 
> > IF NEW.is_canceled IS NOT DISTINCT FROM OLD.is_canceled THEN
> > NEW.is_canceled := etc etc ;
> > ENDIF;
> > There's currently no way to detect if the column was simply not mentioned at all in the UPDATE statement.
>
> That's not completely true: you can make the whole trigger firing
> dependent on that, by writing something like
>
> CREATE TRIGGER tgname BEFORE UPDATE OF column_name [, ... ] ON table ...
>
> and then the trigger won't fire if the column is not mentioned.

Well, this works if I've something like

  IF UPDATING(...) THEN

But since I've

  IF NOT UPDATING(...) THEN

This isn't working. Or am I missing something?

BR
Dirk


--
Dirk Mika
Software Developer

mika:timing GmbH
Strundepark - Kürtener Str. 11b
51465 Bergisch Gladbach
Germany

fon +49 2202 2401-1197
dirk.mika@mikatiming.de
www.mikatiming.de

AG Köln HRB 47509 * WEEE-Reg.-Nr. DE 90029884
Geschäftsführer: Harald Mika, Jörg Mika



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Btree vs. GIN
Next
From: Dirk Mika
Date:
Subject: Re: Trigger with conditional predicates