Re: Checking inequality

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Vitaly Belman <vitalyb(at)gmail(dot)com>
Cc: PostgreSQL general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Checking inequality
Date: 2004-12-11 16:54:40
Message-ID: 20041211085053.D34106@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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).

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-12-11 17:29:21 Re: Sql performace - why soo long ?
Previous Message Wes 2004-12-11 16:44:59 Re: Ridiculous load