Re: Problems with Triggers

From: Sebastian Böck <sebastianboeck(at)freenet(dot)de>
To: Martin Marques <martin(at)bugs(dot)unl(dot)edu(dot)ar>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Problems with Triggers
Date: 2004-04-15 15:35:11
Message-ID: 407EABAF.5030903@freenet.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Martin Marques wrote:
> El Jue 15 Abr 2004 08:55, Sebastian Böck escribió:
>
>>Hello,
>>
>>is there a simple operator to determine whether the OLD.value and
>>NEW.value are different. The <> operator is not working on NULL's.
>>
>>I need something like this:
>>NEW.val <> Old.val OR
>>NEW.val IS NULL AND OLD.val IS NOT NULL OR
>>NEW.val IS NOT NULL AND OLD.val IS NULL
>
>
> (NEW.val <> Old.val) OR
> (NEW.val IS NULL AND OLD.val IS NOT NULL) OR
> (NEW.val IS NOT NULL AND OLD.val IS NULL)
>
> You forgot the parenthesis, to group the conditions accordingly

Yes i did in my mail, but that's not the question.
I wanted to know if there is a special operator that does exactly
this.

Sebastian

In response to

Browse pgsql-general by date

  From Date Subject
Next Message A Palmblad 2004-04-15 15:55:32 pg_clog corruption?
Previous Message Martin Marques 2004-04-15 14:58:27 Re: Problems with Triggers