Re: Checking inequality - Mailing list pgsql-general

From Stephan Szabo
Subject Re: Checking inequality
Date
Msg-id 20041211085053.D34106@megazone.bigpanda.com
Whole thread Raw
In response to Checking inequality  (Vitaly Belman <vitalyb@gmail.com>)
Responses Re: Checking inequality
List pgsql-general
On Sat, 11 Dec 2004, Vitaly Belman wrote:

> I have the following code in one of my trigger functions
>
> ---------------------------------------------------------------
> IF old.series_id<>new.series_id THEN
> ...
> ...
> END IF;
> ---------------------------------------------------------------
>
> The problem is that series_id can change to be NULL in which case I
> have problems as "NULL <> 7" doesn't return "true".

old.series_id IS DISTINCT FROM new.series_id may do what you want
depending on how you want NULLs to compare (IS DISTINCT FROM would be
false).


pgsql-general by date:

Previous
From: Wes
Date:
Subject: Re: Ridiculous load
Next
From: Tom Lane
Date:
Subject: Re: Sql performace - why soo long ?