| От | Tom Lane |
|---|---|
| Тема | Re: Updatable view does not work [oops, quite long!] |
| Дата | |
| Msg-id | 29347.1054785633@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Updatable view does not work [oops, quite long!] (Thiemo Kellner <thiemo@thiam.ch>) |
| Ответы |
Re: Updatable view does not work [oops, quite long!]
|
| Список | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера