Minor correction: cause ALTER ROLE role ROLE rolenames to behave

sensibly, even though we don't document it.
This commit is contained in:
Tom Lane 2005-07-26 22:37:50 +00:00
parent af019fb9ae
commit 0c2d7e39f9
2 changed files with 8 additions and 2 deletions

View File

@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * 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 * 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 void
AlterRole(AlterRoleStmt *stmt) AlterRole(AlterRoleStmt *stmt)

View File

@ -11,7 +11,7 @@
* *
* *
* IDENTIFICATION * 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 * HISTORY
* AUTHOR DATE MAJOR EVENT * AUTHOR DATE MAJOR EVENT
@ -728,6 +728,7 @@ AlterRoleStmt:
{ {
AlterRoleStmt *n = makeNode(AlterRoleStmt); AlterRoleStmt *n = makeNode(AlterRoleStmt);
n->role = $3; n->role = $3;
n->action = +1; /* add, if there are members */
n->options = $5; n->options = $5;
$$ = (Node *)n; $$ = (Node *)n;
} }
@ -764,6 +765,7 @@ AlterUserStmt:
{ {
AlterRoleStmt *n = makeNode(AlterRoleStmt); AlterRoleStmt *n = makeNode(AlterRoleStmt);
n->role = $3; n->role = $3;
n->action = +1; /* add, if there are members */
n->options = $5; n->options = $5;
$$ = (Node *)n; $$ = (Node *)n;
} }