Re: Deprecating RULES

From: Peter Geoghegan <peter(at)2ndquadrant(dot)com>
To: Greg Stark <stark(at)mit(dot)edu>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Deprecating RULES
Date: 2012-10-15 11:37:37
Message-ID: CAEYLb_VDi7vrd5QQu9Z4xcFHkGSpaD8hJ40z0w_qQAc9vZs8oQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 15 October 2012 11:41, Greg Stark <stark(at)mit(dot)edu> wrote:
> On Mon, Oct 15, 2012 at 8:00 AM, Simon Riggs <simon(at)2ndquadrant(dot)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 die a 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2012-10-15 11:53:51 Re: Visual Studio 2012 RC
Previous Message lst_hoe02 2012-10-15 11:30:09 Re: WebSphere Application Server support for postgres