Marc Boucher <[EMAIL PROTECTED]> writes:
> CREATE OR REPLACE RULE albed_updalb3_rl AS 
>    ON UPDATE TO album WHERE new.pls_id != old.pls_id
>   DO
>    UPDATE album_edit SET pls_id=new.pls_id WHERE alb_id=new.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.

That's not a bug.  "foo != NULL" does not yield true, it yields NULL.
You could test for nulls with IS NULL, or possibly use the IS DISTINCT
FROM construct (does 7.3 have that?  I forget.)

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faqs/FAQ.html

Reply via email to