Re: problem with rules - column values lost

Поиск
Список
Период
Сортировка
От 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 по дате отправления:

Предыдущее
От: Daniel Schuchardt
Дата:
Сообщение: problem with rules - column values lost
Следующее
От: Michael Fuhr
Дата:
Сообщение: Re: i want to find