Re: Deprecating RULES

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Greg Stark <stark(at)mit(dot)edu>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, Peter Geoghegan <peter(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Deprecating RULES
Date: 2012-10-15 19:09:23
Message-ID: 20121015190923.GD7494@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Oct 15, 2012 at 12:30:56AM +0100, Greg Stark wrote:
> On Sun, Oct 14, 2012 at 9:30 AM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
> > On 12 October 2012 19:48, Greg Stark <stark(at)mit(dot)edu> wrote:
> >> On Fri, Oct 12, 2012 at 7:55 AM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
> >>> AFAICS all RULEs can be re-expressed as Triggers or Views.
> >>
> >> This is a bizarre discussion. Firstly this isn't even close to true.
> >> The whole source of people's discontentment is that triggers are *not*
> >> equivalent to rules. If they were then they wouldn't be so upset.
> >
> > This may be a confusion on the point of equivalence; clearly the
> > features work differently.
> >
> > I'm not aware of any rule that can't be rewritten as a trigger or a
> > view. Please can anyone show me some examples of those?
>
> Huh? The one thing we currently use rules for, implementing views,
> couldn't be done in triggers. In general if your source table is empty
> then there's *nothing* you could cause to happen with triggers because
> no triggers will fire.
>
> The analogy to this discussion would be something like "users get
> confused by macros in C and usually what they're trying to do can be
> better done with functions. now that we have functions we should
> deprecate macros" All of the preconditions in that sentence are true
> but it doesn't follow because macros exist for a reason.

Well, on a related note, I have heard that Java didn't implement macros
because it confuses context-sensitive editors. Seems like a
wrong-headed reason to remove a feature.

This is not related to my opinion on rules, but I thought it was
interesting.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message ktm@rice.edu 2012-10-15 19:11:13 Re: Deprecating Hash Indexes
Previous Message Jeff Janes 2012-10-15 19:04:43 Re: Deprecating Hash Indexes