Greetings,

  Small patch to clean up the grammer a bit by adding 'GroupId',
  'SchemaName' and 'SavePointId'.  I noticed these issues while
  beginning work on 'Group Ownership'.  Any questions/comments, please
  let me know.

        Thanks,

                Stephen
Index: src/backend/parser/gram.y
===================================================================
RCS file: /projects/cvsroot/pgsql/src/backend/parser/gram.y,v
retrieving revision 2.480
diff -u -u -r2.480 gram.y
--- src/backend/parser/gram.y   8 Nov 2004 04:02:20 -0000       2.480
+++ src/backend/parser/gram.y   29 Dec 2004 15:41:36 -0000
@@ -180,7 +180,7 @@
 %type <list>   OptUserList
 %type <defelt> OptUserElem
 
-%type <str>            OptSchemaName
+%type <str>            SchemaName OptSchemaName
 %type <list>   OptSchemaEltList
 
 %type <boolean> TriggerActionTime TriggerForSpec opt_trusted
@@ -304,7 +304,7 @@
 
 %type <ival>   Iconst
 %type <str>            Sconst comment_text
-%type <str>            UserId opt_boolean ColId_or_Sconst
+%type <str>            UserId GroupId SavePointId opt_boolean ColId_or_Sconst
 %type <list>   var_list var_list_or_default
 %type <str>            ColId ColLabel var_name type_name param_name
 %type <node>   var_value zone_value
@@ -705,7 +705,7 @@
  *****************************************************************************/
 
 CreateGroupStmt:
-                       CREATE GROUP_P UserId opt_with OptGroupList
+                       CREATE GROUP_P GroupId opt_with OptGroupList
                                {
                                        CreateGroupStmt *n = 
makeNode(CreateGroupStmt);
                                        n->name = $3;
@@ -742,7 +742,7 @@
  *****************************************************************************/
 
 AlterGroupStmt:
-                       ALTER GROUP_P UserId add_drop USER user_list
+                       ALTER GROUP_P GroupId add_drop USER user_list
                                {
                                        AlterGroupStmt *n = 
makeNode(AlterGroupStmt);
                                        n->name = $3;
@@ -765,7 +765,7 @@
  *****************************************************************************/
 
 DropGroupStmt:
-                       DROP GROUP_P UserId
+                       DROP GROUP_P GroupId
                                {
                                        DropGroupStmt *n = 
makeNode(DropGroupStmt);
                                        n->name = $3;
@@ -793,7 +793,7 @@
                                        n->schemaElts = $6;
                                        $$ = (Node *)n;
                                }
-                       | CREATE SCHEMA ColId OptSchemaEltList
+                       | CREATE SCHEMA SchemaName OptSchemaEltList
                                {
                                        CreateSchemaStmt *n = 
makeNode(CreateSchemaStmt);
                                        /* ...but not both */
@@ -805,7 +805,7 @@
                ;
 
 OptSchemaName:
-                       ColId                                                   
                { $$ = $1; }
+                       SchemaName                                              
        { $$ = $1; }
                        | /* EMPTY */                                           
        { $$ = NULL; }
                ;
 
@@ -3128,7 +3128,7 @@
                        | grantee_list ',' grantee                              
{ $$ = lappend($1, $3); }
                ;
 
-grantee:       ColId
+grantee:       UserId
                                {
                                        PrivGrantee *n = makeNode(PrivGrantee);
                                        /* This hack lets us avoid reserving 
PUBLIC as a keyword*/
@@ -3139,7 +3139,7 @@
                                        n->groupname = NULL;
                                        $$ = (Node *)n;
                                }
-                       | GROUP_P ColId
+                       | GROUP_P GroupId
                                {
                                        PrivGrantee *n = makeNode(PrivGrantee);
                                        /* Treat GROUP PUBLIC as a synonym for 
PUBLIC */
@@ -3632,7 +3632,7 @@
                                        n->newname = $7;
                                        $$ = (Node *)n;
                                }
-                       | ALTER GROUP_P UserId RENAME TO UserId
+                       | ALTER GROUP_P GroupId RENAME TO GroupId
                                {
                                        RenameStmt *n = makeNode(RenameStmt);
                                        n->renameType = OBJECT_GROUP;
@@ -3997,7 +3997,7 @@
                                        n->options = NIL;
                                        $$ = (Node *)n;
                                }
-                       | SAVEPOINT ColId
+                       | SAVEPOINT SavePointId
                                {
                                        TransactionStmt *n = 
makeNode(TransactionStmt);
                                        n->kind = TRANS_STMT_SAVEPOINT;
@@ -4005,7 +4005,7 @@
                                                                                
                                (Node *)makeString($2)));
                                        $$ = (Node *)n;
                                }
-                       | RELEASE SAVEPOINT ColId
+                       | RELEASE SAVEPOINT SavePointId
                                {
                                        TransactionStmt *n = 
makeNode(TransactionStmt);
                                        n->kind = TRANS_STMT_RELEASE;
@@ -4013,7 +4013,7 @@
                                                                                
                                (Node *)makeString($3)));
                                        $$ = (Node *)n;
                                }
-                       | RELEASE ColId
+                       | RELEASE SavePointId
                                {
                                        TransactionStmt *n = 
makeNode(TransactionStmt);
                                        n->kind = TRANS_STMT_RELEASE;
@@ -4021,7 +4021,7 @@
                                                                                
                                (Node *)makeString($2)));
                                        $$ = (Node *)n;
                                }
-                       | ROLLBACK opt_transaction TO SAVEPOINT ColId
+                       | ROLLBACK opt_transaction TO SAVEPOINT SavePointId
                                {
                                        TransactionStmt *n = 
makeNode(TransactionStmt);
                                        n->kind = TRANS_STMT_ROLLBACK_TO;
@@ -4029,7 +4029,7 @@
                                                                                
                                (Node *)makeString($5)));
                                        $$ = (Node *)n;
                                }
-                       | ROLLBACK opt_transaction TO ColId
+                       | ROLLBACK opt_transaction TO SavePointId
                                {
                                        TransactionStmt *n = 
makeNode(TransactionStmt);
                                        n->kind = TRANS_STMT_ROLLBACK_TO;
@@ -7569,6 +7569,9 @@
 Iconst:                ICONST                                                  
                { $$ = $1; };
 Sconst:                SCONST                                                  
                { $$ = $1; };
 UserId:                ColId                                                   
                { $$ = $1; };
+GroupId:       ColId                                                           
        { $$ = $1; };
+SchemaName:    ColId                                                           
        { $$ = $1; };
+SavePointId:   ColId                                                           
        { $$ = $1; };
 
 /*
  * Name classification hierarchy.
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faqs/FAQ.html

Reply via email to