Rules are the user-interface of the query rewriting system. They allow the user to define how the rewriting will happen, and therefore define how to transform a statement into another.
Before executing the examples of this chapter, it is better to remove all triggers defined in Chapter 6, Triggers, or at least disable them, with the following code:
testdb=# DROP EVENT TRIGGER IF EXISTS etr_avoid_drop_function;
testdb=> ALTER TABLE files DISABLE TRIGGER all;