Re: Deprecating RULES - Mailing list pgsql-hackers

From Josh Berkus
Subject Re: Deprecating RULES
Date
Msg-id 507EF539.3060202@agliodbs.com
Whole thread Raw
In response to Re: Deprecating RULES  (Greg Stark <stark@mit.edu>)
List pgsql-hackers
Greg,

> 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.

This is excellent.  However, if we are actually considerting deprecating
them, we should add the sentence "RULEs may be deprecated in a future
release of PostgreSQL."


-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Deprecating RULES
Next
From: Tom Lane
Date:
Subject: Re: Deprecating RULES