From 943eae92fb7d8c8078a73063429c8c06599b3556 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Tue, 9 Mar 2004 05:05:41 +0000 Subject: Add ALSO keyword to CREATE RULE. Fabien COELHO --- doc/src/sgml/keywords.sgml | 8 +++++++- doc/src/sgml/rules.sgml | 18 +++++++++--------- 2 files changed, 16 insertions(+), 10 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/keywords.sgml b/doc/src/sgml/keywords.sgml index 51e08a360e2..e8f5d9b75c5 100644 --- a/doc/src/sgml/keywords.sgml +++ b/doc/src/sgml/keywords.sgml @@ -1,4 +1,4 @@ - + <acronym>SQL</acronym> Key Words @@ -170,6 +170,12 @@ reserved reserved + + ALSO + non-reserved + + + ALTER non-reserved diff --git a/doc/src/sgml/rules.sgml b/doc/src/sgml/rules.sgml index c719a651de1..a764dcfc5f4 100644 --- a/doc/src/sgml/rules.sgml +++ b/doc/src/sgml/rules.sgml @@ -1,4 +1,4 @@ - + The Rule System @@ -873,7 +873,7 @@ SELECT t1.a, t2.b, t1.ctid FROM t1, t2 WHERE t1.a = t2.a; - They can be INSTEAD or not. + They can be INSTEAD or ALSO (default). @@ -904,7 +904,7 @@ SELECT t1.a, t2.b, t1.ctid FROM t1, t2 WHERE t1.a = t2.a; CREATE RULE rule_name AS ON event TO object [WHERE rule_qualification] - DO [INSTEAD] [action | (actions) | NOTHING]; + DO [ALSO|INSTEAD] [action | (actions) | NOTHING]; in mind. @@ -920,7 +920,7 @@ CREATE RULE rule_name AS ON event Initially the query-tree list is empty. There can be zero (NOTHING key word), one, or multiple actions. To simplify, we will look at a rule with one action. This rule - can have a qualification or not and it can be INSTEAD or not. + can have a qualification or not and it can be INSTEAD or ALSO (default). @@ -937,7 +937,7 @@ CREATE RULE rule_name AS ON event - No qualification and not INSTEAD + No qualification and ALSO the query tree from the rule action with the original query @@ -957,7 +957,7 @@ CREATE RULE rule_name AS ON event - Qualification given and not INSTEAD + Qualification given and ALSO the query tree from the rule action with the rule @@ -980,7 +980,7 @@ CREATE RULE rule_name AS ON event - Finally, if the rule is not INSTEAD, the unchanged original query tree is + Finally, if the rule is ALSO, the unchanged original query tree is added to the list. Since only qualified INSTEAD rules already add the original query tree, we end up with either one or two output query trees for a rule with one action. @@ -1111,7 +1111,7 @@ INSERT INTO shoelace_log VALUES ( - The rule is a qualified non-INSTEAD rule, so the rule system + The rule is a qualified ALSO rule, so the rule system has to return two query trees: the modified rule action and the original query tree. In step 1, the range table of the original query is incorporated into the rule's action query tree. This results in: @@ -1190,7 +1190,7 @@ INSERT INTO shoelace_log VALUES ( - That's it. Since the rule is not INSTEAD, we also output the + That's it. Since the rule is ALSO, we also output the original query tree. In short, the output from the rule system is a list of two query trees that correspond to these statements: -- cgit v1.2.3