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.
server:
-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
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.
+