Update createuser examples to match the current program behavior,
authorTom Lane
Fri, 13 May 2005 16:31:43 +0000 (16:31 +0000)
committerTom Lane
Fri, 13 May 2005 16:31:43 +0000 (16:31 +0000)
and add an example showing assignment of a password.  Per suggestion
from Jari Aalto (via Martin Pitt).

doc/src/sgml/ref/createuser.sgml

index 5af2028b4e5370ac25ab0042400292a2160f577f..f277c53fde95aad19ff0a5049a4e80a8149e4fbd 100644 (file)
@@ -1,5 +1,5 @@
 
 
@@ -68,8 +68,10 @@ PostgreSQL documentation
       username
       
        
-   Specifies the name of the PostgreSQL user to be created. 
-   This name must be unique among all PostgreSQL users.
+        Specifies the name of the PostgreSQL user
+        to be created.
+        This name must be unique among all users of this
+        PostgreSQL installation.
        
       
        
@@ -290,7 +292,7 @@ PostgreSQL documentation
     server:
 
 createuser joe
-Is the new user allowed to create databases? (y/n) n
+Shall the new user be allowed to create databases? (y/n) n
 Shall the new user be allowed to create more new users? (y/n) n
 CREATE USER
 
@@ -301,11 +303,28 @@ PostgreSQL documentation
     server on host eden, port 5000, avoiding the prompts and
     taking a look at the underlying command:
 
-createuser -p 5000 -h eden -D -A -e joe
-CREATE USER "joe" NOCREATEDB NOCREATEUSER
+createuser -h eden -p 5000 -D -A -e joe
+CREATE USER joe NOCREATEDB NOCREATEUSER;
 CREATE USER
 
    
+
+   
+    To create the user joe as a superuser,
+    and assign a password immediately:
+
+createuser -P -d -a -e joe
+Enter password for new user: xyzzy
+Enter it again: xyzzy
+CREATE USER joe PASSWORD 'xyzzy' CREATEDB CREATEUSER;
+CREATE USER
+
+    In the above example, the new password isn't actually echoed when typed,
+    but we show what was typed for clarity.  However the password
+    will appear in the echoed command, as illustrated —
+    so you don't want to use -e when assigning a password, if
+    anyone else can see your screen.
+