The PostgreSQL Rule System

PostgreSQL supports a powerful rule system for the specification of views and ambiguous view updates. This is implemented using a technique called query rewriting. The rewrite system is a module between the parser stage and the planner/optimizer.

For information on the syntax and creation of rules in the PostgreSQL system, refer to Red Hat Database SQL Guide and Reference.

The Rewrite System

The query rewrite system is a module between the parser stage and the planner/optimizer. It processes the parse tree and, by applying any applicable rule present, it rewrites the tree to an alternative form.