OnCallReady

Commands

createuser - define a new PostgreSQL user account

createuser [OPTION]... [ROLENAME]

Options you will use

-P, --pwprompt
assign a password to new role (asked twice).
-d, --createdb
role can create new databases.
-r, --createrole
role can create new roles.
-s, --superuser
role will be superuser.
--replication
role can initiate replication.
-L, --no-login
role cannot login.
-g, --member-of=ROLE
new role will be a member of ROLE.
-c, --connection-limit=N
connection limit for role.
-h, --host=HOSTNAME
database server host or socket directory (default: the Unix socket in /var/run/postgresql). A value starting with / is a socket directory; anything else is TCP.
-p, --port=PORT
database server port (default 5432).
-U, --username=USERNAME
database user name (default: your OS user name).
-w, --no-password
never prompt for a password (fail instead: what scripts want).
-W, --password
force a password prompt (normally automatic).

Examples

$ sudo -u postgres createuser -P reporting

a login role with a password prompt

Try createuser in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.