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

Lines changed: 5 additions & 1 deletion
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

Lines changed: 3 additions & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy