Re: Delete rule does not prevent truncate

Поиск
Список
Период
Сортировка
От Guillaume Lelarge
Тема Re: Delete rule does not prevent truncate
Дата
Msg-id CAECtzeXTz9UeJ94BG495w-Ft-Bhk0RK0eHTyFhO9tGG1P5ZeeA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Delete rule does not prevent truncate  (Tim Smith <randomdev4+postgres@gmail.com>)
Список pgsql-general
2015-07-23 9:06 GMT+02:00 Tim Smith <randomdev4+postgres@gmail.com>:
So tell me guys, instead of bashing away at the fact I only quoted
half a sentence or whatever, how about you answer the following :

What exactly is was the design decision that lead to TRUNCATE being
supported by triggers but not by rules ?


Someone had time to implement it for triggers, no-one had time for rules.
 
I suspect that TRUNCATE was added to triggers because some dev thought
it would be a neat idea, and it was never implemented in rules as a
result of an accidental omission for <whatever reason> rather than a
deliberate design constraint.


It is a neat idea for tiggers. Slony uses that to replicate TRUNCATE on slaves of a Slony cluster.

It wouldn't be such a neat idea for rules as, IIRC, rules are only supported because views are based on them. Without that, they would probably be ripped out of the code.


--

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

Предыдущее
От: Tim Smith
Дата:
Сообщение: Re: Delete rule does not prevent truncate
Следующее
От: Spiros Ioannou
Дата:
Сообщение: Re: Lots of stuck queries after upgrade to 9.4