Re: Strange behavior on plpgsql trigger function in if comparison - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: Strange behavior on plpgsql trigger function in if comparison
Date
Msg-id 47A47315.9080502@dunslane.net
Whole thread Raw
In response to Strange behavior on plpgsql trigger function in if comparison  ("Omar Bettin" <o.bettin@tiscali.it>)
List 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


pgsql-hackers by date:

Previous
From: "Gurjeet Singh"
Date:
Subject: Problem with site doc search
Next
From: Florian Weimer
Date:
Subject: Re: configurability of OOM killer