Improve documentation about CREATEROLE privilege.
authorTom Lane
Thu, 13 Oct 2005 23:26:00 +0000 (23:26 +0000)
committerTom Lane
Thu, 13 Oct 2005 23:26:00 +0000 (23:26 +0000)
doc/src/sgml/ref/grant.sgml
doc/src/sgml/user-manag.sgml

index 57af287dc9cde8d033f83ad001fb299cf4a6b845..8e8196f480d230046db3329ba6c480a029e64b2e 100644 (file)
@@ -1,5 +1,5 @@
 
 
@@ -293,8 +293,12 @@ GRANT role [, ...]
 
   
    If WITH ADMIN OPTION is specified, the member may
-   in turn grant membership in the role to others.  Without the admin
-   option, the recipient cannot do that.
+   in turn grant membership in the role to others, and revoke membership
+   in the role as well.  Without the admin option, ordinary users cannot do
+   that.  However,
+   database superusers can grant or revoke membership in any role to anyone.
+   Roles having CREATEROLE privilege can grant or revoke
+   membership in any role that is not a superuser.
   
  
  
index f42666b8198c33e5cc7c3807a57b30174ee3b686..fea93aec91574861e992e51b4108b23e5ae98784 100644 (file)
@@ -1,5 +1,5 @@
 
 
 
@@ -203,9 +203,10 @@ CREATE USER name;
         checks). To create such a role, use CREATE ROLE
         name CREATEROLE.
         A role with CREATEROLE privilege can alter and drop
-        other roles, too.  However, to alter or drop a superuser role,
-        superuser status is required; CREATEROLE is not sufficient
-        for that.
+        other roles, too, as well as grant or revoke membership in them.
+        However, to create, alter, drop, or change membership of a
+        superuser role, superuser status is required;
+        CREATEROLE is not sufficient for that.
        
       
      
@@ -234,6 +235,16 @@ CREATE USER name;
     endterm="sql-alterrole-title"> commands for details.
    
 
+  
+   
+    It is good practice to create a role that has the CREATEDB
+    and CREATEROLE privileges, but is not a superuser, and then
+    use this role for all routine management of databases and roles.  This
+    approach avoids the dangers of operating as a superuser for tasks that
+    do not really require it.
+   
+  
+
   
    A role can also have role-specific defaults for many of the run-time
    configuration settings described in