createuser
TLDR
Create a user interactively
SYNOPSIS
createuser [options] [username]
DESCRIPTION
createuser is a PostgreSQL utility that creates new database users (roles). It's a wrapper around the SQL CREATE ROLE command, providing a convenient command-line interface.
The tool can create users with various privileges including superuser status, database creation rights, and role creation abilities. It connects to the database server and executes the appropriate SQL.
PARAMETERS
-s, --superuser
Create superuser.-d, --createdb
Allow creating databases.-r, --createrole
Allow creating roles.-l, --login
Allow login (default).-P, --pwprompt
Prompt for password.-e, --echo
Show generated SQL.-h host
Database server host.-p port
Database server port.-U user
Connect as user.-W
Force password prompt.-i, --inherit
Role inherits privileges.--replication
Allow replication connections.
CAVEATS
Requires appropriate privileges to create roles. Superuser creation requires superuser connection. Password set via -P is entered interactively.
HISTORY
createuser has been part of PostgreSQL since early versions, providing a shell interface to role management. PostgreSQL evolved from the POSTGRES project at UC Berkeley in the 1980s. The distinction between users and roles was unified in PostgreSQL 8.1.


