Re: Delete rule does not prevent truncate

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Tim Smith <randomdev4+postgres(at)gmail(dot)com>
Cc: Geoff Winkless <pgsqladmin(at)geoff(dot)dj>, Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Delete rule does not prevent truncate
Date: 2015-07-23 08:19:00
Message-ID: CAECtzeXTz9UeJ94BG495w-Ft-Bhk0RK0eHTyFhO9tGG1P5ZeeA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2015-07-23 9:06 GMT+02:00 Tim Smith <randomdev4+postgres(at)gmail(dot)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.

--
Guillaume.
http://blog.guillaume.lelarge.info
http://www.dalibo.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Spiros Ioannou 2015-07-23 08:31:18 Re: Lots of stuck queries after upgrade to 9.4
Previous Message Tim Smith 2015-07-23 07:06:19 Re: Delete rule does not prevent truncate