Checking inequality

From: Vitaly Belman <vitalyb(at)gmail(dot)com>
To: PostgreSQL general <pgsql-general(at)postgresql(dot)org>
Subject: Checking inequality
Date: 2004-12-11 12:42:21
Message-ID: fa96e3c6041211044264048fa8@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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".

What can I do to check inequality even in the case that old or new
series_id is NULL? I'd prefer not to do zillion silly comparisons
(like "IS NULL and IS NOT NULL"). Is there an easy way?

--
ICQ: 1912453
AIM: VitalyB1984
MSN: tmdagent(at)hotmail(dot)com
Yahoo!: VitalyBe

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Devrim GUNDUZ 2004-12-11 12:46:05 Re: Postgres 7.4.6 x86_64 RPMS
Previous Message NosyMan 2004-12-11 12:30:30 PREPARED STATEMENT