Re: Updatable view does not work [oops, quite long!]

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thiemo Kellner <thiemo(at)thiam(dot)ch>
Cc: pgNovice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Updatable view does not work [oops, quite long!]
Date: 2003-06-05 04:00:33
Message-ID: 29347.1054785633@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Thiemo Kellner <thiemo(at)thiam(dot)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

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message root 2003-06-05 05:39:02 Re: locale support ?
Previous Message Tom Lane 2003-06-05 03:17:25 Re: Calculation error