Skip to content

Commit 9649b18

Browse files
committed
Fix documentation error: GRANT/REVOKE for roles only accept role names
as grantees, not PUBLIC ... and you can't say GROUP either. Noted by Brian Hurt.
1 parent efc861a commit 9649b18

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

doc/src/sgml/ref/grant.sgml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/grant.sgml,v 1.59 2006/07/20 18:00:03 momjian Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/grant.sgml,v 1.60 2006/08/02 16:29:49 tgl Exp $
33
PostgreSQL documentation
44
-->
55

@@ -50,8 +50,7 @@ GRANT { CREATE | ALL [ PRIVILEGES ] }
5050
ON TABLESPACE <replaceable>tablespacename</> [, ...]
5151
TO { <replaceable class="PARAMETER">username</replaceable> | GROUP <replaceable class="PARAMETER">groupname</replaceable> | PUBLIC } [, ...] [ WITH GRANT OPTION ]
5252

53-
GRANT <replaceable class="PARAMETER">role</replaceable> [, ...]
54-
TO { <replaceable class="PARAMETER">username</replaceable> | GROUP <replaceable class="PARAMETER">groupname</replaceable> | PUBLIC } [, ...] [ WITH ADMIN OPTION ]
53+
GRANT <replaceable class="PARAMETER">role</replaceable> [, ...] TO <replaceable class="PARAMETER">username</replaceable> [, ...] [ WITH ADMIN OPTION ]
5554
</synopsis>
5655
</refsynopsisdiv>
5756

@@ -325,6 +324,12 @@ GRANT <replaceable class="PARAMETER">role</replaceable> [, ...]
325324
Roles having <literal>CREATEROLE</> privilege can grant or revoke
326325
membership in any role that is not a superuser.
327326
</para>
327+
328+
<para>
329+
Unlike the case with privileges, membership in a role cannot be granted
330+
to <literal>PUBLIC</>. Note also that this form of the command does not
331+
allow the noise word <literal>GROUP</>.
332+
</para>
328333
</refsect2>
329334
</refsect1>
330335

doc/src/sgml/ref/revoke.sgml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/revoke.sgml,v 1.38 2006/04/30 21:15:33 tgl Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/revoke.sgml,v 1.39 2006/08/02 16:29:49 tgl Exp $
33
PostgreSQL documentation
44
-->
55

@@ -65,8 +65,7 @@ REVOKE [ GRANT OPTION FOR ]
6565
[ CASCADE | RESTRICT ]
6666

6767
REVOKE [ ADMIN OPTION FOR ]
68-
<replaceable class="PARAMETER">role</replaceable> [, ...]
69-
FROM { <replaceable class="PARAMETER">username</replaceable> | GROUP <replaceable class="PARAMETER">groupname</replaceable> | PUBLIC } [, ...]
68+
<replaceable class="PARAMETER">role</replaceable> [, ...] FROM <replaceable class="PARAMETER">username</replaceable> [, ...]
7069
[ CASCADE | RESTRICT ]
7170
</synopsis>
7271
</refsynopsisdiv>
@@ -119,6 +118,8 @@ REVOKE [ ADMIN OPTION FOR ]
119118
<para>
120119
When revoking membership in a role, <literal>GRANT OPTION</> is instead
121120
called <literal>ADMIN OPTION</>, but the behavior is similar.
121+
Note also that this form of the command does not
122+
allow the noise word <literal>GROUP</>.
122123
</para>
123124
</refsect1>
124125

doc/src/sgml/user-manag.sgml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/user-manag.sgml,v 1.35 2006/04/30 21:15:32 tgl Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/user-manag.sgml,v 1.36 2006/08/02 16:29:49 tgl Exp $ -->
22

33
<chapter id="user-manag">
44
<title>Database Roles and Privileges</title>
@@ -375,7 +375,9 @@ REVOKE <replaceable>group_role</replaceable> FROM <replaceable>role1</replaceabl
375375
</synopsis>
376376
You can grant membership to other group roles, too (since there isn't
377377
really any distinction between group roles and non-group roles). The
378-
only restriction is that you can't set up circular membership loops.
378+
database will not let you set up circular membership loops. Also,
379+
it is not permitted to grant membership in a role to
380+
<literal>PUBLIC</literal>.
379381
</para>
380382

381383
<para>

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