Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
rules.html21 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>Chapter 41. The 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="event-trigger-table-rewrite-example.html" title="40.5. A Table Rewrite Event Trigger Example" /><link rel="next" href="querytree.html" title="41.1. The Query Tree" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">Chapter 41. The Rule System</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="event-trigger-table-rewrite-example.html" title="40.5. A Table Rewrite Event Trigger Example">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="server-programming.html" title="Part V. Server Programming">Up</a></td><th width="60%" align="center">Part V. Server Programming</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="querytree.html" title="41.1. The Query Tree">Next</a></td></tr></table><hr /></div><div class="chapter" id="RULES"><div class="titlepage"><div><div><h2 class="title">Chapter 41. The Rule System</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="sect1"><a href="querytree.html">41.1. The Query Tree</a></span></dt><dt><span class="sect1"><a href="rules-views.html">41.2. Views and the Rule System</a></span></dt><dd><dl><dt><span class="sect2"><a href="rules-views.html#RULES-SELECT">41.2.1. How <code class="command">SELECT</code> Rules Work</a></span></dt><dt><span class="sect2"><a href="rules-views.html#RULES-VIEWS-NON-SELECT">41.2.2. View Rules in Non-<code class="command">SELECT</code> Statements</a></span></dt><dt><span class="sect2"><a href="rules-views.html#RULES-VIEWS-POWER">41.2.3. The Power of Views in <span class="productname">PostgreSQL</span></a></span></dt><dt><span class="sect2"><a href="rules-views.html#RULES-VIEWS-UPDATE">41.2.4. Updating a View</a></span></dt></dl></dd><dt><span class="sect1"><a href="rules-materializedviews.html">41.3. Materialized Views</a></span></dt><dt><span class="sect1"><a href="rules-update.html">41.4. Rules on <code class="command">INSERT</code>, <code class="command">UPDATE</code>, and <code class="command">DELETE</code></a></span></dt><dd><dl><dt><span class="sect2"><a href="rules-update.html#RULES-UPDATE-HOW">41.4.1. How Update Rules Work</a></span></dt><dt><span class="sect2"><a href="rules-update.html#RULES-UPDATE-VIEWS">41.4.2. Cooperation with Views</a></span></dt></dl></dd><dt><span class="sect1"><a href="rules-privileges.html">41.5. Rules and Privileges</a></span></dt><dt><span class="sect1"><a href="rules-status.html">41.6. Rules and Command Status</a></span></dt><dt><span class="sect1"><a href="rules-triggers.html">41.7. Rules Versus Triggers</a></span></dt></dl></div><a id="id-1.8.6.2" class="indexterm"></a><p>3     This chapter discusses the rule system in4     <span class="productname">PostgreSQL</span>.  Production rule systems5     are conceptually simple, but there are many subtle points6     involved in actually using them.7</p><p>8     Some other database systems define active database rules, which9     are usually stored procedures and triggers.  In10     <span class="productname">PostgreSQL</span>, these can be implemented11     using functions and triggers as well.12</p><p>13     The rule system (more precisely speaking, the query rewrite rule14     system) is totally different from stored procedures and triggers.15     It modifies queries to take rules into consideration, and then16     passes the modified query to the query planner for planning and17     execution.  It is very powerful, and can be used for many things18     such as query language procedures, views, and versions.  The19     theoretical foundations and the power of this rule system are20     also discussed in <a class="xref" href="biblio.html#STON90B">[ston90b]</a> and <a class="xref" href="biblio.html#ONG90">[ong90]</a>.21</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="event-trigger-table-rewrite-example.html" title="40.5. A Table Rewrite Event Trigger Example">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="server-programming.html" title="Part V. Server Programming">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="querytree.html" title="41.1. The Query Tree">Next</a></td></tr><tr><td width="40%" align="left" valign="top">40.5. A Table Rewrite Event Trigger Example </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"> 41.1. The Query Tree</td></tr></table></div></body></html>
codekingpro/portable-devtools · Team Ai