Re: Multiple-action rule surprise

Поиск
Список
Период
Сортировка
От Andrew - Supernews
Тема Re: Multiple-action rule surprise
Дата
Msg-id slrndf58jf.bj3.andrew+nonews@trinity.supernews.net
обсуждение исходный текст
Ответ на Multiple-action rule surprise  ("Eugene Shekhtman" <postgre@xenomics.com>)
Список pgsql-bugs
On 2005-08-04, "Eugene Shekhtman" <postgre@xenomics.com> wrote:
> PostgreSQL version: 8.0.3
> OS: Win32 (Win 2003 Server)
>
> There is something strange and counterintuitive about the way that
> multiple-action PostgreSQL rules work.

The absolute first thing you must learn about using rules in postgresql
is that _rules are not procedural logic_, i.e. you can't express them as
"if (a) then do B".  Rules rewrite the command _before_ anything is
executed (indeed before anything is even planned).  At the time of
rewriting, there is no way to know whether the WHERE clause of a rule will
be matched, so the rule is always expanded the same way, and the WHERE
clause becomes part of the rewritten command.

--
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services

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

Предыдущее
От: Jaime Casanova
Дата:
Сообщение: Re: Multiple-action rule surprise
Следующее
От: "Janet Hempstead"
Дата:
Сообщение: BUG #1807: cannot build postgresql: libascii_and_mic.so.0.0: No such file or directory