Re: NULL != text ?

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Alban Hertroys <alban(at)magproductions(dot)nl>
Cc: Michael Glaesemann <grzm(at)myrealbox(dot)com>, CSN <cool_screen_name90001(at)Yahoo(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: NULL != text ?
Date: 2005-10-21 02:32:50
Message-ID: 43585352.8000805@Yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/20/2005 6:10 AM, Alban Hertroys wrote:

> 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)

That would result in TRUE if both, OLD and NEW are NULL. Is that what
you intended?

Jan

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

--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck(at)Yahoo(dot)com #

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Patrick TJ McPhee 2005-10-21 03:51:14 Re: PSQL suggested enhancement
Previous Message Marc G. Fournier 2005-10-21 00:45:29 Re: [pgsql-advocacy] Oracle buys Innobase