OS Manuals

/usr/bin/createuser

PostgreSQL client

From postgresql-12-client 12.18-r4 (os), captured 2026-11-05 by running createuser --help (exit 0). permalink

Also provided by 11 other package versions
createuser creates a new PostgreSQL role.

Usage:
  createuser [OPTION]... [ROLENAME]

Options:
  -c, --connection-limit=N  connection limit for role (default: no limit)
  -d, --createdb            role can create new databases
  -D, --no-createdb         role cannot create databases (default)
  -e, --echo                show the commands being sent to the server
  -g, --role=ROLE           new role will be a member of this role
  -i, --inherit             role inherits privileges of roles it is a
                            member of (default)
  -I, --no-inherit          role does not inherit privileges
  -l, --login               role can login (default)
  -L, --no-login            role cannot login
  -P, --pwprompt            assign a password to new role
  -r, --createrole          role can create new roles
  -R, --no-createrole       role cannot create roles (default)
  -s, --superuser           role will be superuser
  -S, --no-superuser        role will not be superuser (default)
  -V, --version             output version information, then exit
  --interactive             prompt for missing role name and attributes rather
                            than using defaults
  --replication             role can initiate replication
  --no-replication          role cannot initiate replication
  -?, --help                show this help, then exit

Connection options:
  -h, --host=HOSTNAME       database server host or socket directory
  -p, --port=PORT           database server port
  -U, --username=USERNAME   user name to connect as (not the one to create)
  -w, --no-password         never prompt for password
  -W, --password            force password prompt

Report bugs to <pgsql-bugs@lists.postgresql.org>.
Options (24)
OptionDescriptionSource
-c, --connection-limit Nconnection limit for role (default: no limit)help
-d, --createdbrole can create new databaseshelp
-D, --no-createdbrole cannot create databases (default)help
-e, --echoshow the commands being sent to the serverhelp
-g, --role ROLEnew role will be a member of this rolehelp
-i, --inheritrole inherits privileges of roles it is a member of (default)help
-I, --no-inheritrole does not inherit privilegeshelp
-l, --loginrole can login (default)help
-L, --no-loginrole cannot loginhelp
-P, --pwpromptassign a password to new rolehelp
-r, --createrolerole can create new roleshelp
-R, --no-createrolerole cannot create roles (default)help
-s, --superuserrole will be superuserhelp
-S, --no-superuserrole will not be superuser (default)help
-V, --versionoutput version information, then exithelp
--interactiveprompt for missing role name and attributes rather than using defaultshelp
--replicationrole can initiate replicationhelp
--no-replicationrole cannot initiate replicationhelp
-?, --helpshow this help, then exithelp
-h, --host HOSTNAMEdatabase server host or socket directoryhelp
-p, --port PORTdatabase server porthelp
-U, --username USERNAMEuser name to connect as (not the one to create)help
-w, --no-passwordnever prompt for passwordhelp
-W, --passwordforce password prompthelp

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.