Re: AW: Problems with RULE

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: AW: Problems with RULE
Дата
Msg-id 9754.983983435@sss.pgh.pa.us
обсуждение исходный текст
Ответ на AW: Problems with RULE  ("Jens Hartwig" <jens.hartwig@t-systems.de>)
Список pgsql-sql
"Jens Hartwig" <jens.hartwig@t-systems.de> writes:
> What would have happened, if I executed an unconditional DELETE?
>   => DELETE FROM t_xyz;
> Which statement would have been generated by PostgreSQL in this case?

Unfortunately, I didn't keep the prior discussion, so I don't remember
exactly what the rule was.  But the general idea for conditional rules
is that we generate

rule-action
WHERE rule-action's-own-conditions     AND rule-condition     AND conditions-from-original-query

(repeat for each action of each relevant rule) and then if we didn't
find any relevant unconditional INSTEAD rules, we generate

original-query-action
WHERE conditions-from-original-query     AND NOT (conditions-of-conditional-INSTEAD-rules)

There's a more extensive discussion in the Programmer's Guide,
http://www.postgresql.org/devel-corner/docs/postgres/rules.html
        regards, tom lane


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

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: No Documentation for to_char(INTERVAL, mask)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [DOCS] Extending PostgreSQL Using C