Re: Delete rule does not prevent truncate - Mailing list pgsql-general

From Guillaume Lelarge
Subject Re: Delete rule does not prevent truncate
Date
Msg-id CAECtzeXTz9UeJ94BG495w-Ft-Bhk0RK0eHTyFhO9tGG1P5ZeeA@mail.gmail.com
Whole thread Raw
In response to Re: Delete rule does not prevent truncate  (Tim Smith <randomdev4+postgres@gmail.com>)
List 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 by date:

Previous
From: Tim Smith
Date:
Subject: Re: Delete rule does not prevent truncate
Next
From: Spiros Ioannou
Date:
Subject: Re: Lots of stuck queries after upgrade to 9.4