Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
2a08204e
Commit
2a08204e
authored
Apr 12, 2000
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update man page to prefer old over current.
parent
52f77df6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
doc/src/sgml/ref/create_rule.sgml
doc/src/sgml/ref/create_rule.sgml
+12
-12
No files found.
doc/src/sgml/ref/create_rule.sgml
View file @
2a08204e
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_rule.sgml,v 1.1
4 2000/04/07 19:17:30
momjian Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_rule.sgml,v 1.1
5 2000/04/12 20:07:13
momjian Exp $
Postgres documentation
-->
...
...
@@ -71,7 +71,7 @@ CREATE RULE <replaceable class="parameter">name</replaceable> AS ON <replaceable
<listitem>
<para>
Any SQL WHERE clause, <literal>new</literal> or
<literal>
current
</literal> can appear instead of an instance
<literal>
old
</literal> can appear instead of an instance
variable whenever an instance variable is permissible in SQL.
</para>
</listitem>
...
...
@@ -81,7 +81,7 @@ CREATE RULE <replaceable class="parameter">name</replaceable> AS ON <replaceable
<listitem>
<para>
Any SQL statement, <literal>new</literal> or
<literal>
current
</literal> can appear instead of an instance
<literal>
old
</literal> can appear instead of an instance
variable whenever an instance variable is permissible in SQL.
</para>
</listitem>
...
...
@@ -133,17 +133,17 @@ CREATE
<para>
The semantics of a rule is that at the time an individual instance is
accessed, inserted, updated, or deleted, there is a
current
instance (for
accessed, inserted, updated, or deleted, there is a
old
instance (for
selects, updates and deletes) and a new instance (for inserts and
updates).
If the <replaceable class="parameter">event</replaceable>
specified in the ON clause and the
<replaceable class="parameter">condition</replaceable> specified in the
WHERE clause are true for the
current
instance, the
WHERE clause are true for the
old
instance, the
<replaceable class="parameter">action</replaceable> part of the rule is
executed. First, however, values from fields in the
current
instance
executed. First, however, values from fields in the
old
instance
and/or the new instance are substituted for
<literal>
current
.</literal><replaceable class="parameter">attribute-name</replaceable>
<literal>
old
.</literal><replaceable class="parameter">attribute-name</replaceable>
and <literal>new.</literal><replaceable class="parameter">attribute-name</replaceable>.
</para>
...
...
@@ -167,7 +167,7 @@ CREATE
<replaceable class="parameter">condition</replaceable> and
<replaceable class="parameter">action</replaceable> parts of a rule,
they are all considered different tuple variables. More accurately,
<literal>new</literal> and <literal>
current
</literal> are the only tuple
<literal>new</literal> and <literal>
old
</literal> are the only tuple
variables that are shared between these clauses. For example, the following
two rules have the same semantics:
<programlisting>
...
...
@@ -263,7 +263,7 @@ SELECT * FROM emp;
<programlisting>
CREATE RULE example_1 AS
ON UPDATE emp.salary WHERE
current
.name = "Joe"
ON UPDATE emp.salary WHERE
old
.name = "Joe"
DO
UPDATE emp
SET salary = new.salary
...
...
@@ -271,7 +271,7 @@ CREATE RULE example_1 AS
</programlisting>
At the time Joe receives a salary adjustment, the event
will become true and Joe's
current
instance and proposed
will become true and Joe's
old
instance and proposed
new instance are available to the execution routines.
Hence, his new salary is substituted into the action part
of the rule which is subsequently executed. This propagates
...
...
@@ -282,7 +282,7 @@ CREATE RULE example_1 AS
<programlisting>
CREATE RULE example_2 AS
ON SELECT TO EMP.salary
WHERE
current
.name = "Bill"
WHERE
old
.name = "Bill"
DO INSTEAD
SELECT emp.salary
FROM emp
...
...
@@ -297,7 +297,7 @@ CREATE RULE example_2 AS
CREATE RULE example_3 AS
ON
SELECT TO emp.salary
WHERE
current
.dept = "shoe" AND current_user = "Joe"
WHERE
old
.dept = "shoe" AND current_user = "Joe"
DO INSTEAD NOTHING;
</programlisting>
</para>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment