Re: Proof of concept: auto updatable views [Review of Patch]

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Proof of concept: auto updatable views [Review of Patch]
Дата
Msg-id 28665.1352396239@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Proof of concept: auto updatable views [Review of Patch]  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Ответы Re: Proof of concept: auto updatable views [Review of Patch]  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Список pgsql-hackers
Dean Rasheed <dean.a.rasheed@gmail.com> writes:
> If we did nothing here then it would go on to either fire any INSTEAD
> OF triggers or raise an error if there aren't any. The problem with
> that is that it makes trigger-updatable views and auto-updatable views
> inconsistent in their behaviour with qualified INSTEAD rules. I don't
> think the existing interaction between trigger-updatable views and
> qualified INSTEAD rules is documented, so perhaps that's something
> that needs work.

I'm still unhappy about this decision though, and after further thought
I think I can explain why a bit better: it's actually *not* like the way
rules work now.  The current rule semantics are basically that:

1. The original query is done only if there are no unconditional INSTEAD
rules and no conditional INSTEAD rule's condition is true.

2. Unconditional INSTEAD actions are done, well, unconditionally.

3. Each conditional INSTEAD action is done if its condition is true.

I believe that the right way to think about the auto-update
transformation is that it should act like a supplied-by-default
unconditional INSTEAD rule.  Which would mean that it happens
unconditionally, per #2.  As submitted, though, the auto-update query
executes only if there are no unconditional INSTEAD rules *and* no
conditional INSTEAD rule's condition is true.  I do not think this is
either consistent or useful.  It's treating the auto-update replacement
query as if it were the original, which it is not.
        regards, tom lane



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

Предыдущее
От: Amit kapila
Дата:
Сообщение: Re: Performance Improvement by reducing WAL for Update Operation
Следующее
От: "Karl O. Pinc"
Дата:
Сообщение: Re: Doc patch, distinguish sections with an empty row in error code table