Re: Trigger with conditional predicates

Поиск
Список
Период
Сортировка
От Dirk Mika
Тема Re: Trigger with conditional predicates
Дата
Msg-id 9CB1A2F2-1B40-4B14-AF71-8DC129B806A0@mikatiming.de
обсуждение исходный текст
Ответ на Re: Trigger with conditional predicates  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Btree vs. GIN
Следующее
От: Dirk Mika
Дата:
Сообщение: Re: Trigger with conditional predicates