]> granicus.if.org Git - postgresql/commitdiff
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 493a6bf79044b1aa327c3860d6ad4f7ebe776d80..6ef612dc4a9dad8ee84de62fdd18902f49a0d06b 100644 (file)
@@ -6,7 +6,7 @@
  * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/backend/commands/user.c,v 1.158 2005/07/26 16:38:26 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/user.c,v 1.159 2005/07/26 22:37:49 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -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 4d21d4eb9f527459aa166e6084f59f5aead0f44e..3ce9ec411b74490454cd42e732bd151c706f9409 100644 (file)
@@ -11,7 +11,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.503 2005/07/26 16:38:27 tgl Exp $
+ *       $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.504 2005/07/26 22:37:50 tgl Exp $
  *
  * HISTORY
  *       AUTHOR                        DATE                    MAJOR EVENT
@@ -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;
                                 }