aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2001-07-12 18:03:00 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2001-07-12 18:03:00 +0000
commit3284758a17b23a7d475171b21f72dec7134e89be (patch)
treefa600a9cf6057ed34255c6592796bfaf3ab09827 /src/interfaces
parent5c4d1398a64b5573b653205e19650914e078f168 (diff)
downloadpostgresql-3284758a17b23a7d475171b21f72dec7134e89be.tar.gz
postgresql-3284758a17b23a7d475171b21f72dec7134e89be.zip
Remove grammar restrictions on order of optional clauses in CREATE GROUP.
From Vince Vielhaber.
Diffstat (limited to 'src/interfaces')
-rw-r--r--src/interfaces/ecpg/preproc/preproc.y31
1 files changed, 20 insertions, 11 deletions
diff --git a/src/interfaces/ecpg/preproc/preproc.y b/src/interfaces/ecpg/preproc/preproc.y
index 41455566be0..902b1774121 100644
--- a/src/interfaces/ecpg/preproc/preproc.y
+++ b/src/interfaces/ecpg/preproc/preproc.y
@@ -331,7 +331,7 @@ make_name(void)
%type <str> select_clause opt_select_limit select_limit_value ConstraintTimeSpec
%type <str> select_offset_value ReindexStmt join_type opt_boolean
%type <str> join_qual update_list AlterSchemaStmt joined_table
-%type <str> opt_level opt_lock lock_type users_in_new_group_clause
+%type <str> opt_level opt_lock lock_type OptGroupList OptGroupElem
%type <str> OptConstrFromTable comment_op OptTempTableName StringConst
%type <str> constraints_set_list constraints_set_namelist comment_fn
%type <str> constraints_set_mode comment_type comment_cl comment_ag
@@ -691,23 +691,32 @@ user_list: user_list ',' UserId
*
*
****************************************************************************/
-CreateGroupStmt: CREATE GROUP UserId
+CreateGroupStmt: CREATE GROUP UserId OptGroupList
{
- $$ = cat2_str(make_str("create group"), $3);
+ $$ = cat_str(3, make_str("create group"), $3, $4);
}
- | CREATE GROUP UserId WITH users_in_new_group_clause
+ | CREATE GROUP UserId WITH OptGroupList
{
$$ = cat_str(4, make_str("create group"), $3, make_str("with"), $5);
}
- | CREATE GROUP UserId WITH SYSID Iconst users_in_new_group_clause
+ ;
+
+/*
+ * Options for CREATE GROUP
+ */
+OptGroupList: OptGroupList OptGroupElem { $$ = cat2_str($1, $2); }
+ | /* EMPTY */ { $$ = EMPTY; }
+ ;
+
+OptGroupElem: USER user_list
+ {
+ $$ = cat2_str(make_str("user"), $2);
+ }
+ | SYSID Iconst
{
- $$ = cat_str(5, make_str("create group"), $3, make_str("with sysid"), $6, $7);
+ $$ = cat2_str(make_str("sysid"), $2);
}
- ;
-
-users_in_new_group_clause: USER user_list { $$ = cat2_str(make_str("user"), $2); }
- | /* EMPTY */ { $$ = EMPTY; }
- ;
+ ;
/*****************************************************************************