Skip site navigation (1) Skip section navigation (2)

Re: Problem with rule and null value

From: Harald Armin Massa <haraldarminmassa(at)gmail(dot)com>
To: Marc Boucher <marcb(at)box100(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Problem with rule and null value
Date: 2004-10-24 10:12:31
Message-ID: 7be3f35d041024031266ba39dd@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-bugs
>    ON UPDATE TO album WHERE new.pls_id != old.pls_id

> It works until new.pls_id or old.pls_id is null. The rule is still called
> (based on my test), but the "DO" query is not executed correctly. The
> values in "album_edit" are not updated.


To compare "NULL" to something is allways a bad idea. The behaviour in
Postgres is exactly as documented and specified within the
SQL-standard.

BUT... that is quite different from what you would expect.

To test on "NULL" values within SQL only "is null" is helpfull.

I would strongly recommend to you to read the appropriate chapters
about Null-Values. It seems strange at first but managable.

Harald

In response to

pgsql-bugs by date

Next:From: Harald Armin MassaDate: 2004-10-24 10:17:01
Subject: Re: select() failed in statistics collector
Previous:From: Harald Armin MassaDate: 2004-10-24 10:07:00
Subject: Re: Beta3 much slower than Beta2

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group