Re: Deprecating RULES

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Deprecating RULES
Date: 2012-10-17 18:50:31
Message-ID: 507EFDF7.9000402@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10/17/12 10:46 AM, Greg Stark wrote:
> Warning: RULES are tricky to use correctly. They rewrite the original
> query into a new query before it is run and it is very hard to
> correctly anticipate and rewrite every possible input query into the
> desired result. There are also unexpected interactions with other
> components when RULES do something unexpected such as rewrite a single
> query to return two result sets.
>
> For most applications it's much simpler and more predictable to use
> TRIGGERs. ROW level triggers are evaluated for each row the original
> query is about to process (or has just finished processing) and this
> makes them much easier to follow. Statement level TRIGGERs can be used
> for audit logs and similar operations which need to run once per
> statement.

as a relative novice, I concur, this is clear, concise, and to the point.

--
john r pierce N 37, W 122
santa cruz ca mid-left coast

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Farina 2012-10-17 19:06:46 Re: Deprecating RULES
Previous Message Christopher Browne 2012-10-17 18:48:45 Re: [RFC] CREATE QUEUE (log-only table) for londiste/pgQ ccompatibility