1
- <!-- $PostgreSQL: pgsql/doc/src/sgml/rules.sgml,v 1.33 2003/12/13 23:59:06 neilc Exp $ -->
1
+ <!-- $PostgreSQL: pgsql/doc/src/sgml/rules.sgml,v 1.34 2004/03/09 05:05:40 momjian Exp $ -->
2
2
3
3
<Chapter Id="rules">
4
4
<Title>The Rule System</Title>
@@ -873,7 +873,7 @@ SELECT t1.a, t2.b, t1.ctid FROM t1, t2 WHERE t1.a = t2.a;
873
873
874
874
<ListItem>
875
875
<Para>
876
- They can be <literal>INSTEAD</> ornot .
876
+ They can be <literal>INSTEAD</> or<literal>ALSO</> (default) .
877
877
</Para>
878
878
</ListItem>
879
879
@@ -904,7 +904,7 @@ SELECT t1.a, t2.b, t1.ctid FROM t1, t2 WHERE t1.a = t2.a;
904
904
<ProgramListing>
905
905
CREATE RULE <replaceable>rule_name</> AS ON <replaceable>event</>
906
906
TO <replaceable>object</> [WHERE <replaceable>rule_qualification</>]
907
- DO [INSTEAD] [<replaceable>action</> | (<replaceable>actions</>) | NOTHING];
907
+ DO [ALSO| INSTEAD] [<replaceable>action</> | (<replaceable>actions</>) | NOTHING];
908
908
</ProgramListing>
909
909
910
910
in mind.
@@ -920,7 +920,7 @@ CREATE RULE <replaceable>rule_name</> AS ON <replaceable>event</>
920
920
Initially the query-tree list is empty.
921
921
There can be zero (<literal>NOTHING</> key word), one, or multiple actions.
922
922
To simplify, we will look at a rule with one action. This rule
923
- can have a qualification or not and it can be <literal>INSTEAD</> ornot .
923
+ can have a qualification or not and it can be <literal>INSTEAD</> or<literal>ALSO</> (default) .
924
924
</Para>
925
925
926
926
<Para>
@@ -937,7 +937,7 @@ CREATE RULE <replaceable>rule_name</> AS ON <replaceable>event</>
937
937
938
938
<variablelist>
939
939
<varlistentry>
940
- <term>No qualification andnot <literal>INSTEAD </></term>
940
+ <term>No qualification and <literal>ALSO </></term>
941
941
<listitem>
942
942
<para>
943
943
the query tree from the rule action with the original query
@@ -957,7 +957,7 @@ CREATE RULE <replaceable>rule_name</> AS ON <replaceable>event</>
957
957
</varlistentry>
958
958
959
959
<varlistentry>
960
- <term>Qualification given andnot <literal>INSTEAD </></term>
960
+ <term>Qualification given and <literal>ALSO </></term>
961
961
<listitem>
962
962
<para>
963
963
the query tree from the rule action with the rule
@@ -980,7 +980,7 @@ CREATE RULE <replaceable>rule_name</> AS ON <replaceable>event</>
980
980
</varlistentry>
981
981
</variablelist>
982
982
983
- Finally, if the rule isnot <literal>INSTEAD </>, the unchanged original query tree is
983
+ Finally, if the rule is <literal>ALSO </>, the unchanged original query tree is
984
984
added to the list. Since only qualified <literal>INSTEAD</> rules already add the
985
985
original query tree, we end up with either one or two output query trees
986
986
for a rule with one action.
@@ -1111,7 +1111,7 @@ INSERT INTO shoelace_log VALUES (
1111
1111
</Para>
1112
1112
1113
1113
<Para>
1114
- The rule is a qualifiednon- <literal>INSTEAD </> rule, so the rule system
1114
+ The rule is a qualified <literal>ALSO </> rule, so the rule system
1115
1115
has to return two query trees: the modified rule action and the original
1116
1116
query tree. In step 1, the range table of the original query is
1117
1117
incorporated into the rule's action query tree. This results in:
@@ -1190,7 +1190,7 @@ INSERT INTO shoelace_log VALUES (
1190
1190
</para>
1191
1191
1192
1192
<para>
1193
- That's it. Since the rule isnot <literal>INSTEAD </>, we also output the
1193
+ That's it. Since the rule is <literal>ALSO </>, we also output the
1194
1194
original query tree. In short, the output from the rule system
1195
1195
is a list of two query trees that correspond to these statements:
1196
1196