Re: What about improving the rules system we have, was Re: Rules going away

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Harald Fuchs <hari(dot)fuchs(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: What about improving the rules system we have, was Re: Rules going away
Date: 2011-09-28 17:01:03
Message-ID: CAHyXU0yTv8nMa2fJ5-SzHAi-GVCeZCbYuXWNNnLA6Cd0oL3VhQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Sep 28, 2011 at 11:46 AM, Harald Fuchs <hari(dot)fuchs(at)gmail(dot)com> wrote:
> In article <4116(dot)1317226367(at)sss(dot)pgh(dot)pa(dot)us>,
> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
>
>> Not sure this specific proposal makes any sense at all.  IMO the only
>> real advantage that rules have over triggers is that they work on a
>> set-operation basis not a tuple-by-tuple basis.
>
> Isn't that what statement-level triggers are for, at least in other DB
> systems?  How about telling PostgreSQL's statement-level triggers
> something about the set of rows they affect?

in theory that would be nice, but they just don't work that way. you
don't even have access to the SQL statement firing the trigger IIRC.
that said, with some thought you could work an 'after' trigger into a
set level operation, say, by rigging something around now().

now that we have view triggers (not that rules ever really worked for
updating views anyways), even notwithstanding the minor limitations of
triggers of rules vs triggers, I personally find the RULE feature to
be useless and dangerous. I'd vote for immediately deprecating it
without hesitation.

merlin

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Venkat Balaji 2011-09-28 17:14:12 : Looking for a PostgreSQL book
Previous Message Harald Fuchs 2011-09-28 16:46:02 Re: What about improving the rules system we have, was Re: Rules going away