Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
rule-system.html30 linesDownload Raw Back to html
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>52.4. The PostgreSQL Rule System</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="parser-stage.html" title="52.3. The Parser Stage" /><link rel="next" href="planner-optimizer.html" title="52.5. Planner/Optimizer" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">52.4. The <span class="productname">PostgreSQL</span> Rule System</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="parser-stage.html" title="52.3. The Parser Stage">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="overview.html" title="Chapter 52. Overview of PostgreSQL Internals">Up</a></td><th width="60%" align="center">Chapter 52. Overview of PostgreSQL Internals</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 16.3 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="planner-optimizer.html" title="52.5. Planner/Optimizer">Next</a></td></tr></table><hr /></div><div class="sect1" id="RULE-SYSTEM"><div class="titlepage"><div><div><h2 class="title" style="clear: both">52.4. The <span class="productname">PostgreSQL</span> Rule System <a href="#RULE-SYSTEM" class="id_link">#</a></h2></div></div></div><p>3    <span class="productname">PostgreSQL</span> supports a powerful4    <em class="firstterm">rule system</em> for the specification5    of <em class="firstterm">views</em> and ambiguous <em class="firstterm">view updates</em>.6    Originally the <span class="productname">PostgreSQL</span>7    rule system consisted of two implementations:8 9    </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>10       The first one worked using <em class="firstterm">row level</em> processing and was11       implemented deep in the <em class="firstterm">executor</em>. The rule system was12       called whenever an individual row had been accessed. This13       implementation was removed in 1995 when the last official release14       of the <span class="productname">Berkeley Postgres</span> project was15       transformed into <span class="productname">Postgres95</span>.16      </p></li><li class="listitem"><p>17       The second implementation of the rule system is a technique18       called <em class="firstterm">query rewriting</em>.19       The <em class="firstterm">rewrite system</em> is a module20       that exists between the <em class="firstterm">parser stage</em> and the21       <em class="firstterm">planner/optimizer</em>. This technique is still implemented.22      </p></li></ul></div><p>23   </p><p>24    The query rewriter is discussed in some detail in25    <a class="xref" href="rules.html" title="Chapter 41. The Rule System">Chapter 41</a>, so there is no need to cover it here.26    We will only point out that both the input and the output of the27    rewriter are query trees, that is, there is no change in the28    representation or level of semantic detail in the trees.  Rewriting29    can be thought of as a form of macro expansion.30   </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="parser-stage.html" title="52.3. The Parser Stage">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="overview.html" title="Chapter 52. Overview of PostgreSQL Internals">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="planner-optimizer.html" title="52.5. Planner/Optimizer">Next</a></td></tr><tr><td width="40%" align="left" valign="top">52.3. The Parser Stage </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 16.3 Documentation">Home</a></td><td width="40%" align="right" valign="top"> 52.5. Planner/Optimizer</td></tr></table></div></body></html>
codekingpro/portable-devtools · Team Ai