Update Triggers & NULLs

Поиск
Список
Период
Сортировка
От Gregory Wood
Тема Update Triggers & NULLs
Дата
Msg-id 002101c0d328$41a24500$7889ffcc@comstock.com
обсуждение исходный текст
Список pgsql-general
I have a plpgsql update trigger on one of my tables. The intention of the
trigger is to check to see if a particular field is updated, and if so
INSERT a record into another table. The IF statement looks something like
this:

IF new.MyField <> old.MyField THEN

This works great when MyField has an actual value and is being changed to a
new value. The problem is the <> expression is false if new.MyField or
old.MyField are NULL.

Is there a way to do this without having to write three different boolean
expressions?

Greg


В списке pgsql-general по дате отправления:

Предыдущее
От: newsreader@mediaone.net
Дата:
Сообщение: Re: disk usage advice needed
Следующее
От: Feite Brekeveld
Дата:
Сообщение: update ... from where id in (..) question