Re: NULL != text ?

From: Alban Hertroys <alban(at)magproductions(dot)nl>
To: Michael Glaesemann <grzm(at)myrealbox(dot)com>
Cc: CSN <cool_screen_name90001(at)yahoo(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: NULL != text ?
Date: 2005-10-20 10:10:17
Message-ID: 43576D09.9090305@magproductions.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)magproductions(dot)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//

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message surabhi.ahuja 2005-10-20 10:11:51 Re: server , client encoding issue
Previous Message Janning Vygen 2005-10-20 09:36:40 doc typo sql-reindex.html psql vs. postgres