Re: Updatable view does not work [oops, quite long!] - Mailing list pgsql-novice

From Tom Lane
Subject Re: Updatable view does not work [oops, quite long!]
Date
Msg-id 29347.1054785633@sss.pgh.pa.us
Whole thread Raw
In response to Updatable view does not work [oops, quite long!]  (Thiemo Kellner <thiemo@thiam.ch>)
Responses Re: Updatable view does not work [oops, quite long!]  (Thiemo Kellner <thiemo@thiam.ch>)
List pgsql-novice
Thiemo Kellner <thiemo@thiam.ch> writes:
> However, I have written two more rules, one for updates and one for
> deletes. But those only work if all the fields have values. They do
> nothing with effect on the base table when applied on rows with NULL in
> the fields.

Not very surprising, since "WHERE foo = bar" cannot succeed if either
foo or bar is null.

You should not be comparing every field of the rows anyway.  You should
make sure that pwd has a primary key (which by definition must be
non-null) and then check only the primary key field or fields in the
rule WHERE clauses.

            regards, tom lane

pgsql-novice by date:

Previous
From: root
Date:
Subject: Re: locale support ?
Next
From: chestie
Date:
Subject: Re: Calculation error