Re: Rules: A Modest Proposal

From: David Fetter <david(at)fetter(dot)org>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Rules: A Modest Proposal
Date: 2009-10-04 22:42:33
Message-ID: 20091004224233.GM4964@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Oct 04, 2009 at 04:07:40PM -0400, Robert Haas wrote:
> On Sun, Oct 4, 2009 at 3:34 PM, David Fetter <david(at)fetter(dot)org> wrote:
> >> What would be the benefit of this radical proposal?
> >
> > The radical proposal was the RULE system.  It's been tested now,
> > and it's pretty much failed.
>
> You still haven't explained what actual benefit we'd get out of
> doing this.

Removing land mines is a benefit.

> I agree that rules, except for SELECT rules, don't seem to be very
> useful. Perhaps others have found them so, but I have found
> triggers to be a better fit for everything that I ever want to do.
> Every time I think, hmm, maybe I could use a rule for that, I reread
> the chapter and change my mind.

It's people who either don't read the chapter or don't change their
mind who get in all that trouble. Actually using RULEs is just
cruisin' for a bruisin'.

> However, there is a very real possibility that there are people out
> there who have applications that are based on the way rules work
> today. If we were to remove support for rules, they would not be able
> to upgrade past 8.4. That seems to me to be the sort of thing that we
> wouldn't want to do unless we had a good reason - and the closest
> you've come to saying what you think that reason might be is "they're
> mostly a foot-gun", which I don't find very compelling.

In another post, I proposed a deprecation and removal strategy. If
someone has a use case I haven't named, they've yet to chime in. Of
course, it's a little early yet, but I've seen a *lot* of PostgreSQL
deployments, and none of them had RULEs for anything but the cases I
mentioned.

> I think we want to be moving in the direction of making upgrading
> easier, not more difficult, and that means maintaining backward
> compatibility even for features that are of marginal utility, unless
> they're getting in the way of something else.

Well, there's a utilitarian argument for not having land mines in our
code. To call what RULEs can do to your assumptions about how things
work (data integrity, etc.) in PostgreSQL, "astonishing" would be an
understatement.

As for the upgrades, you've made an interesting point. I suspect that
for the cases mentioned, there could be a mechanical way to do what
needs doing.

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Larry Rosenman 2009-10-04 22:50:45 Re: Rules: A Modest Proposal
Previous Message Robert Haas 2009-10-04 22:15:54 Re: Buffer usage in EXPLAIN and pg_stat_statements (review)