Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0c2d7e3

Browse files
committed
Minor correction: cause ALTER ROLE role ROLE rolenames to behave
sensibly, even though we don't document it.
1 parent af019fb commit 0c2d7e3

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/backend/commands/user.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
* $PostgreSQL: pgsql/src/backend/commands/user.c,v 1.158 2005/07/26 16:38:26 tgl Exp $
9+
* $PostgreSQL: pgsql/src/backend/commands/user.c,v 1.159 2005/07/26 22:37:49 tgl Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -377,6 +377,10 @@ CreateRole(CreateRoleStmt *stmt)
377377

378378
/*
379379
* ALTER ROLE
380+
*
381+
* Note: the rolemembers option accepted here is intended to support the
382+
* backwards-compatible ALTER GROUP syntax. Although it will work to say
383+
* "ALTER ROLE role ROLE rolenames", we don't document it.
380384
*/
381385
void
382386
AlterRole(AlterRoleStmt *stmt)

src/backend/parser/gram.y

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.503 2005/07/26 16:38:27 tgl Exp $
14+
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.504 2005/07/26 22:37:50 tgl Exp $
1515
*
1616
* HISTORY
1717
* AUTHOR DATE MAJOR EVENT
@@ -728,6 +728,7 @@ AlterRoleStmt:
728728
{
729729
AlterRoleStmt *n = makeNode(AlterRoleStmt);
730730
n->role = $3;
731+
n->action = +1; /* add, if there are members */
731732
n->options = $5;
732733
$$ = (Node *)n;
733734
}
@@ -764,6 +765,7 @@ AlterUserStmt:
764765
{
765766
AlterRoleStmt *n = makeNode(AlterRoleStmt);
766767
n->role = $3;
768+
n->action = +1; /* add, if there are members */
767769
n->options = $5;
768770
$$ = (Node *)n;
769771
}

0 commit comments

Comments
 (0)