Re: [HACKERS] Strange behavior on plpgsql trigger function in if comparison

2008-02-02 Thread Andrew Dunstan
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 <> NE

Re: [HACKERS] Strange behavior on plpgsql trigger function in if comparison

2008-02-02 Thread Stefan Kaltenbrunner
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.

[HACKERS] Strange behavior on plpgsql trigger function in if comparison

2008-02-02 Thread Omar Bettin
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 NU