Re: Deprecating RULES

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

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.

Secondly the only reason views work is because they're implemented
using rules. If you want to do anything similar but different from
views you would need to use rules as well. I'm still waiting on
updateable views for example.

It sounds like what people are really looking for is to move the
section of the manual describing rules to an "internals" section of
the manual and add a note saying "do not try to use rules to implement
triggers. they are not triggers" that explains how they're different
and what they're useful for.

In general user manuals, especially ones written like Unix man pages,
tend to describe what things do without explaining why that might be
useful. That's leaves users faced with a decision between trying
similar-sounding features like rules and triggers and they might pick
the wrong one. The Postgres manual is better than most in this respect
but this is one area where it might pay to be extra clear.

--
greg

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-10-12 18:48:46 Re: dumping recursive views broken in master
Previous Message Hannu Krosing 2012-10-12 18:32:06 Re: Deprecating RULES