Re: CREATE RULE on VIEW with INSERT after UPDATE does not work

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: CREATE RULE on VIEW with INSERT after UPDATE does not work
Дата
Msg-id 4309.1186765804@sss.pgh.pa.us
обсуждение исходный текст
Ответ на CREATE RULE on VIEW with INSERT after UPDATE does not work  ("Peter Marius" <Peter.Marius@gmx.de>)
Ответы Re: CREATE RULE on VIEW with INSERT after UPDATE does not work
Список pgsql-general
"Peter Marius" <Peter.Marius@gmx.de> writes:
> I created a view on all entries with stop=null.

> The DB-Interaction should be done over the view,
> so I added rules for INSERT, UPDATE an DELETE.

> Insert and Update work fine, but the DELETE_RULE
> stopps after the first UPDATE statement in the Rule-Body,
> any further statements are ignored!!

Once you change the stop field to not be null, the row's no longer part
of the view, so there's nothing to update.  You need to re-order the
operations (and, probably, combine the two UPDATE commands) so that you
don't remove the row from the view until the last step.

            regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: Ben
Дата:
Сообщение: Re: Configuration starting point...
Следующее
От: Raymond O'Donnell
Дата:
Сообщение: Re: How I can know a back up database is up to date