Re: NULL != text ?

Поиск
Список
Период
Сортировка
От Alban Hertroys
Тема Re: NULL != text ?
Дата
Msg-id 43576D09.9090305@magproductions.nl
обсуждение исходный текст
Ответ на Re: NULL != text ?  (Michael Glaesemann <grzm@myrealbox.com>)
Ответы Re: NULL != text ?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: NULL != text ?  (Jan Wieck <JanWieck@Yahoo.com>)
Список pgsql-general
Michael Glaesemann wrote:
> if (OLD.value IS NOT NULL and NEW.value IS NOT NULL and OLD.value <>
> NEW.value) or OLD.value IS NULL or NEW.value IS NULL
>
> But that's untested and I have a hard time thinking in three-value  logic.

For completeness sake; Because of lazy evaluation, that boils down to:

if (OLD.value IS NULL OR NEW.value IS NULL OR OLD.value <> NEW.value)

The last part of the expression is only evaluated if both OLD.value and
NEW.value aren't NULL.

--
Alban Hertroys
alban@magproductions.nl

magproductions b.v.

T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
    7500 AK Enschede

//Showing your Vision to the World//

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

Предыдущее
От: Janning Vygen
Дата:
Сообщение: doc typo sql-reindex.html psql vs. postgres
Следующее
От: "surabhi.ahuja"
Дата:
Сообщение: Re: server , client encoding issue