Postgresql 中文操作指南
52.4. The PostgreSQL Rule System #
PostgreSQL 支持一个强大的 rule system,用于指定 views 和模棱两可的 view updates。最初,PostgreSQL 规则系统包含两种实现:
PostgreSQL supports a powerful rule system for the specification of views and ambiguous view updates. Originally the PostgreSQL rule system consisted of two implementations:
对于查询重写器,在 Chapter 41 中进行了详细的讨论,因此无需在此进行介绍。我们将仅指出一棵输入和输出重写器都是查询树,也就是说,树中的表示或语义细节级别没有发生变化。重写可以看作是一种宏扩展。
The query rewriter is discussed in some detail in Chapter 41, so there is no need to cover it here. We will only point out that both the input and the output of the rewriter are query trees, that is, there is no change in the representation or level of semantic detail in the trees. Rewriting can be thought of as a form of macro expansion.