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