Fix documentation error: GRANT/REVOKE for roles only accept role names
authorTom Lane <[email protected]>
Wed, 2 Aug 2006 16:30:00 +0000 (16:30 +0000)
committerTom Lane <[email protected]>
Wed, 2 Aug 2006 16:30:00 +0000 (16:30 +0000)
as grantees, not PUBLIC ... and you can't say GROUP either.  Noted by
Brian Hurt.

doc/src/sgml/ref/grant.sgml
doc/src/sgml/ref/revoke.sgml
doc/src/sgml/user-manag.sgml

index 6fdb1307dd52d0101b93f5b135f70883fba29d76..d0636cd8abb62e358ee0b71e95a265c63252238a 100644 (file)
@@ -45,8 +45,7 @@ GRANT { CREATE | ALL [ PRIVILEGES ] }
     ON TABLESPACE <replaceable>tablespacename</> [, ...]
     TO { <replaceable class="PARAMETER">username</replaceable> | GROUP <replaceable class="PARAMETER">groupname</replaceable> | PUBLIC } [, ...] [ WITH GRANT OPTION ]
 
-GRANT <replaceable class="PARAMETER">role</replaceable> [, ...]
-    TO { <replaceable class="PARAMETER">username</replaceable> | GROUP <replaceable class="PARAMETER">groupname</replaceable> | PUBLIC } [, ...] [ WITH ADMIN OPTION ]
+GRANT <replaceable class="PARAMETER">role</replaceable> [, ...] TO <replaceable class="PARAMETER">username</replaceable> [, ...] [ WITH ADMIN OPTION ]
 </synopsis>
  </refsynopsisdiv>
 
@@ -300,6 +299,12 @@ GRANT <replaceable class="PARAMETER">role</replaceable> [, ...]
    Roles having <literal>CREATEROLE</> privilege can grant or revoke
    membership in any role that is not a superuser.
   </para>
+
+  <para>
+   Unlike the case with privileges, membership in a role cannot be granted
+   to <literal>PUBLIC</>.  Note also that this form of the command does not
+   allow the noise word <literal>GROUP</>.
+  </para>
  </refsect2>
  </refsect1>
 
index 463f58ba84e320eb2c2b61c23de3c0bcdbd9f968..298f23bc435e1907854fe7df62749fd4a02b0c40 100644 (file)
@@ -58,8 +58,7 @@ REVOKE [ GRANT OPTION FOR ]
     [ CASCADE | RESTRICT ]
 
 REVOKE [ ADMIN OPTION FOR ]
-    <replaceable class="PARAMETER">role</replaceable> [, ...]
-    FROM { <replaceable class="PARAMETER">username</replaceable> | GROUP <replaceable class="PARAMETER">groupname</replaceable> | PUBLIC } [, ...]
+    <replaceable class="PARAMETER">role</replaceable> [, ...] FROM <replaceable class="PARAMETER">username</replaceable> [, ...]
     [ CASCADE | RESTRICT ]
 </synopsis>
  </refsynopsisdiv>
@@ -112,6 +111,8 @@ REVOKE [ ADMIN OPTION FOR ]
   <para>
    When revoking membership in a role, <literal>GRANT OPTION</> is instead
    called <literal>ADMIN OPTION</>, but the behavior is similar.
+   Note also that this form of the command does not
+   allow the noise word <literal>GROUP</>.
   </para>
  </refsect1>
 
index 1f4428630e98479c9bc495a4e4785306784087fe..c2ffa1bd68a52837e7d910d246a887719c58f24e 100644 (file)
@@ -377,7 +377,9 @@ REVOKE <replaceable>group_role</replaceable> FROM <replaceable>role1</replaceabl
 </synopsis>
    You can grant membership to other group roles, too (since there isn't
    really any distinction between group roles and non-group roles).  The
-   only restriction is that you can't set up circular membership loops.
+   database will not let you set up circular membership loops.  Also,
+   it is not permitted to grant membership in a role to
+   <literal>PUBLIC</literal>.
   </para>
 
   <para>