CREATEUSER(1) PostgreSQL 18.6 Documentation CREATEUSER(1) (NAME) createuser - PostgreSQL (SYNOPSIS) createuser [connection-option...] [option...] [username] (DESCRIPTION) createuser ( ) PostgreSQL . CREATEROLE createuser CREATEROLE . SUPERUSER REPLICATION BYPASSRLS CREATEROLE. . CREATEROLE . createuser SQL CREATE ROLE . . (OPTIONS) createuser : username PostgreSQL . PostgreSQL . -a role --with-admin=role admin . -a . -c number --connection-limit=number . . -d --createdb . -D --no-createdb . . -e --echo createuser (echo). -E --encrypted . -g role --member-of=role --role=role () . -g . -i --inherit . . -I --no-inherit . --interactive -d/-D -r/-R -s/-S . ( PostgreSQL 9.1 .) -l --login ( ). . -L --no-login . ( .) -m role --with-member=role . -m . -P --pwprompt createuser . . -r --createrole CREATEROLE . (role creation) . -R --no-createrole . . -s --superuser (superuser) . -S --no-superuser . . -v timestamp --valid-until=timestamp . . -V --version createuser . --bypassrls (RLS) . --no-bypassrls (RLS) . . --replication REPLICATION CREATE ROLE (CREATE_ROLE(7)) . --no-replication REPLICATION CREATE ROLE (CREATE_ROLE(7)) . . -? --help createuser . createuser : -h host --host=host (host name) . () (Unix domain socket) . -p port --port=port TCP . -U username --username=username ( ). -w --no-password . .pgpass . (batch jobs) . -W --password createuser ( ). createuser . createuser . -W . PGHOST PGPORT PGUSER PG_COLOR . always auto never. PostgreSQL libpq ( 32.15 ). (DIAGNOSTICS) CREATE ROLE (CREATE_ROLE(7)) psql(1) . . libpq . (EXAMPLES) joe : $ createuser joe joe : $ createuser --interactive joe Shall the new role be a superuser? (y/n) n Shall the new role be allowed to create databases? (y/n) n Shall the new role be allowed to create more new roles? (y/n) n joe eden 5000 : $ createuser -h eden -p 5000 -S -D -R -e joe CREATE ROLE joe NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN; joe (superuser) : $ createuser -P -s -e joe Enter password for new role: xyzzy Enter it again: xyzzy CREATE ROLE joe PASSWORD 'SCRAM-SHA-256$4096:44560wPMLfjqiAzyPDZ/eQ==$4CA054rZlSFEq8Z3FEhToBTa2X6KnWFxFkPwIbKoDe0=:L/nbSZRCjp6RhOhKK56GoR1zibCCSePKshCJ9lnl3yw=' SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN NOREPLICATION NOBYPASSRLS; . ..SH " (SEE ALSO)" dropuser(1), CREATE ROLE (CREATE_ROLE(7)), createrole_self_grant PostgreSQL 18.6 2026 CREATEUSER(1)