Minor correction: cause ALTER ROLE role ROLE rolenames to behave
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 26 Jul 2005 22:37:50 +0000 (22:37 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 26 Jul 2005 22:37:50 +0000 (22:37 +0000)
sensibly, even though we don't document it.

src/backend/commands/user.c
src/backend/parser/gram.y

index b355cd0183891cd98f7b28cd191e2da7a90c3a95..892fa68a84cba502dc30d3d77df00ec95f3bfaad 100644 (file)
@@ -377,6 +377,10 @@ CreateRole(CreateRoleStmt *stmt)
 
 /*
  * ALTER ROLE
+ *
+ * Note: the rolemembers option accepted here is intended to support the
+ * backwards-compatible ALTER GROUP syntax.  Although it will work to say
+ * "ALTER ROLE role ROLE rolenames", we don't document it.
  */
 void
 AlterRole(AlterRoleStmt *stmt)
index e157ee0bb7768a8299ca41cd98cc10743366dd30..f72dce70229c5185775041ee3fd065db68e323b2 100644 (file)
@@ -728,6 +728,7 @@ AlterRoleStmt:
                                 {
                                        AlterRoleStmt *n = makeNode(AlterRoleStmt);
                                        n->role = $3;
+                                       n->action = +1; /* add, if there are members */
                                        n->options = $5;
                                        $$ = (Node *)n;
                                 }
@@ -764,6 +765,7 @@ AlterUserStmt:
                                 {
                                        AlterRoleStmt *n = makeNode(AlterRoleStmt);
                                        n->role = $3;
+                                       n->action = +1; /* add, if there are members */
                                        n->options = $5;
                                        $$ = (Node *)n;
                                 }