| От | Tom Lane |
|---|---|
| Тема | Re: problem with rules - column values lost |
| Дата | |
| Msg-id | 3141.1111907368@sss.pgh.pa.us обсуждение |
| Ответ на | problem with rules - column values lost (Daniel Schuchardt <daniel_schuchardt@web.de>) |
| Список | pgsql-hackers |
Daniel Schuchardt <daniel_schuchardt@web.de> writes:
> there seem to be a bug in the 8.0 Rule System if I update a view and
> does not give a column an value.
You can't seriously expect that example to work. The DELETE removes the
row that lang_abzu() needs to have in order to yield a non-null result,
and so the reference to new.abz_txt in the next line yields a null.
new.* and old.* in rules are macros; they don't represent some sort of
internally held data, but re-evaluations of the relevant definitions.
In particular, new.abz_txt in the last line of the rule references
the view definition if the invoking UPDATE didn't specify any particular
new value for the column.
It might be that you could get the effect you want with triggers ...
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера