Re: Strange behavior on plpgsql trigger function in if comparison

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Omar Bettin <o(dot)bettin(at)tiscali(dot)it>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Strange behavior on plpgsql trigger function in if comparison
Date: 2008-02-02 13:41:41
Message-ID: 47A47315.9080502@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Omar Bettin wrote:
> Hi,
>
> I have to compare an OLD.Value with a NEW.Value on PostgreSQL 8.2.4
> plpgsql trigger function:
>
> IF OLD.Value <> NEW.Value THEN
> ...
>
> but, if OLD.Value IS NULL and NOT NEW.Value IS NULL the previous IF
> does not work and I have to use this method:
>
> IF (OLD.Value <> NEW.Value) OR (OLD.Value IS NULL AND NOT NEW.Value
> IS NULL) THEN
> ...
>
> this works!
> Is that normal ?
>
>

Please do not ask usage questions on the -hackers list. This should have
been asked on the pgsql-general list.

cheers

andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Volkan Yazıcı 2008-02-02 13:54:45 Re: BK-Tree Implementation on top of GiST
Previous Message Gurjeet Singh 2008-02-02 13:18:39 Problem with site doc search