10
10
*
11
11
*
12
12
* IDENTIFICATION
13
- * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.52 1999/02/06 20:27:34 tgl Exp $
13
+ * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.53 1999/02/07 19:02:19 wieck Exp $
14
14
*
15
15
* HISTORY
16
16
* AUTHOR DATE MAJOR EVENT
@@ -132,7 +132,7 @@ Oid param_type(int t); /* used in parse_expr.c */
132
132
CreatedbStmt, DestroydbStmt, VacuumStmt, CursorStmt, SubSelect,
133
133
UpdateStmt, InsertStmt, select_w_o_sort, SelectStmt, NotifyStmt, DeleteStmt,
134
134
ClusterStmt, ExplainStmt, VariableSetStmt, VariableShowStmt, VariableResetStmt,
135
- CreateUserStmt, AlterUserStmt, DropUserStmt
135
+ CreateUserStmt, AlterUserStmt, DropUserStmt, RuleActionStmt
136
136
137
137
%type <str> opt_database1, opt_database2, location, encoding
138
138
@@ -163,7 +163,7 @@ Oid param_type(int t); /* used in parse_expr.c */
163
163
result, relation_name_list, OptTableElementList,
164
164
OptInherit, definition,
165
165
opt_with, func_args, func_args_list,
166
- oper_argtypes, OptStmtList, OptStmtBlock, OptStmtMulti ,
166
+ oper_argtypes, RuleActionList, RuleActionBlock, RuleActionMulti ,
167
167
opt_column_list, columnList, opt_va_list, va_list,
168
168
sort_clause, sortby_list, index_params, index_list, name_list,
169
169
from_clause, from_list, opt_array_bounds, nest_array_bounds,
@@ -2058,7 +2058,7 @@ opt_column: COLUMN { $$ = COLUMN; }
2058
2058
RuleStmt: CREATE RULE name AS
2059
2059
{ QueryIsRule=TRUE; }
2060
2060
ON event TO event_object where_clause
2061
- DO opt_instead OptStmtList
2061
+ DO opt_instead RuleActionList
2062
2062
{
2063
2063
RuleStmt *n = makeNode(RuleStmt);
2064
2064
n->rulename = $3;
@@ -2071,34 +2071,31 @@ RuleStmt: CREATE RULE name AS
2071
2071
}
2072
2072
;
2073
2073
2074
- OptStmtList: NOTHING { $$ = NIL; }
2075
- | OptimizableStmt { $$ = lcons($1, NIL); }
2076
- | '[' OptStmtBlock ']' { $$ = $2; }
2077
- /***S*I*D***/
2078
- /* We comment this out because it produces a shift / reduce conflict
2079
- * with the select_w_o_sort rule */
2080
- /* | '(' OptStmtBlock ')' { $$ = $2; } */
2074
+ RuleActionList: NOTHING { $$ = NIL; }
2075
+ | SelectStmt { $$ = lcons($1, NIL); }
2076
+ | RuleActionStmt { $$ = lcons($1, NIL); }
2077
+ | '[' RuleActionBlock ']' { $$ = $2; }
2078
+ | '(' RuleActionBlock ')' { $$ = $2; }
2081
2079
;
2082
2080
2083
- OptStmtBlock: OptStmtMulti
2084
- { $$ = $1; }
2085
- | OptimizableStmt
2086
- { $$ = lcons($1, NIL); }
2081
+ RuleActionBlock: RuleActionMulti { $$ = $1; }
2082
+ | RuleActionStmt { $$ = lcons($1, NIL); }
2087
2083
;
2088
2084
2089
- OptStmtMulti : OptStmtMulti OptimizableStmt ';'
2085
+ RuleActionMulti : RuleActionMulti RuleActionStmt
2090
2086
{ $$ = lappend($1, $2); }
2091
- /***S*I***/
2092
- /* We comment the next rule because it seems to be redundant
2093
- * and produces 16 shift/reduce conflicts with the new SelectStmt rule
2094
- * needed for EXCEPT and INTERSECT. So far I did not notice any
2095
- * violations by removing the rule! */
2096
- /* | OptStmtMulti OptimizableStmt
2097
- { $$ = lappend($1, $2); } */
2098
- | OptimizableStmt ';'
2087
+ | RuleActionMulti RuleActionStmt ';'
2088
+ { $$ = lappend($1, $2); }
2089
+ | RuleActionStmt ';'
2099
2090
{ $$ = lcons($1, NIL); }
2100
2091
;
2101
2092
2093
+ RuleActionStmt: InsertStmt
2094
+ | UpdateStmt
2095
+ | DeleteStmt
2096
+ | NotifyStmt
2097
+ ;
2098
+
2102
2099
event_object: relation_name '.' attr_name
2103
2100
{
2104
2101
$$ = makeNode(Attr);
0 commit comments