Re: Deprecating RULES - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: Deprecating RULES
Date
Msg-id CAEYLb_VDi7vrd5QQu9Z4xcFHkGSpaD8hJ40z0w_qQAc9vZs8oQ@mail.gmail.com
Whole thread Raw
In response to Re: Deprecating RULES  (Greg Stark <stark@mit.edu>)
List pgsql-hackers
On 15 October 2012 11:41, Greg Stark <stark@mit.edu> wrote:
> On Mon, Oct 15, 2012 at 8:00 AM, Simon Riggs <simon@2ndquadrant.com> wrote:
>> Please can anyone show me the SQL for a rule that cannot be written as
>> a view or a trigger? I do not believe such a thing exists and I will
>> provide free beer to the first person that can prove me wrong.
>
> Being written as a view doesn't help you because views use rules. I
> repeat, the very fact that we need rules to implement views prove
> rules are necessary for some purposes.

Well, the usual way that this proposal is phrased is that user-defined
rules should be deprecated. Granted, that wasn't the case on this
occasion, but it has been on many other occasions.

It's not as if we there isn't a clear separation between what we all
agree are "good rules" (that is, ON SELECT DO
INSTEAD SELECT rules, which views are technically very simple wrappers
of) and "bad rules" (that is, everything else).

Humorous aside: I saw this comment within view.c, that dates from the
Postgres95 days at the latest (but is probably older still):
* This update consists of adding two new entries IN THE BEGINNING* of the range table (otherwise the rule system will
diea slow,* horrible and painful death, and we do not want that now, do we?)
 

I'm not sure that the authors' remarks about not wanting that should
be taken at face value...

-- 
Peter Geoghegan       http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training and Services



pgsql-hackers by date:

Previous
From: Will Crawford
Date:
Subject: Re: Successor of MD5 authentication, let's use SCRAM
Next
From: Noah Misch
Date:
Subject: Re: Visual Studio 2012 RC