{"Entry":{"collection":"tool","key":"createuser","name":"createuser","aliases":["createuser"],"metadata":{"aliases":["createuser"],"category":"Client applications","content_hash":"11e7d2afacaae9254332a7d6627ef025edce40af6ad13e32e7e043e77a553924","imported_at":"2026-09-30T00:40:33.875523+08:00","name":"createuser","name_zh":"","slug":"createuser","summary":"createuser — define a new PostgreSQL user account"}},"Definition":{"Collection":"tool","Key":"createuser","SourceDatabase":"center","Version":"18","SourceTable":"command_tool","SourceKey":"createuser","SourceRevision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","Facts":{"comparison_data":{"environment":[{"description":"Default connection parameters","name":"PGHOST PGPORT PGUSER"},{"description":"Specifies whether to use color in diagnostic messages. Possible values are always , auto and never .","name":"PG_COLOR"}],"options":[{"description":"Specifies an existing role that will be automatically added as a member of the new role with admin option, giving it the right to grant membership in the new role to others. Multiple existing roles can be specified by writing multiple -a switches.","names":["-a role","--with-admin= role"],"signature":"-a role --with-admin= role"},{"description":"Set a maximum number of connections for the new user. The default is to set no limit.","names":["-c number","--connection-limit= number"],"signature":"-c number --connection-limit= number"},{"description":"The new user will be allowed to create databases.","names":["-d","--createdb"],"signature":"-d --createdb"},{"description":"The new user will not be allowed to create databases. This is the default.","names":["-D","--no-createdb"],"signature":"-D --no-createdb"},{"description":"Echo the commands that createuser generates and sends to the server.","names":["-e","--echo"],"signature":"-e --echo"},{"description":"This option is obsolete but still accepted for backward compatibility.","names":["-E","--encrypted"],"signature":"-E --encrypted"},{"description":"Specifies the new role should be automatically added as a member of the specified existing role. Multiple existing roles can be specified by writing multiple -g switches.","names":["-g role","--member-of= role","--role= role"],"signature":"-g role --member-of= role --role= role (deprecated)"},{"description":"The new role will automatically inherit privileges of roles it is a member of. This is the default.","names":["-i","--inherit"],"signature":"-i --inherit"},{"description":"The new role will not automatically inherit privileges of roles it is a member of.","names":["-I","--no-inherit"],"signature":"-I --no-inherit"},{"description":"Prompt for the user name if none is specified on the command line, and also prompt for whichever of the options -d / -D , -r / -R , -s / -S is not specified on the command line. (This was the default behavior up to PostgreSQL 9.1.)","names":["--interactive"],"signature":"--interactive"},{"description":"The new user will be allowed to log in (that is, the user name can be used as the initial session user identifier). This is the default.","names":["-l","--login"],"signature":"-l --login"},{"description":"The new user will not be allowed to log in. (A role without login privilege is still useful as a means of managing database permissions.)","names":["-L","--no-login"],"signature":"-L --no-login"},{"description":"Specifies an existing role that will be automatically added as a member of the new role. Multiple existing roles can be specified by writing multiple -m switches.","names":["-m role","--with-member= role"],"signature":"-m role --with-member= role"},{"description":"If given, createuser will issue a prompt for the password of the new user. This is not necessary if you do not plan on using password authentication.","names":["-P","--pwprompt"],"signature":"-P --pwprompt"},{"description":"The new user will be allowed to create, alter, drop, comment on, change the security label for other roles; that is, this user will have CREATEROLE privilege. See role creation for more details about what capabilities are conferred by this privilege.","names":["-r","--createrole"],"signature":"-r --createrole"},{"description":"The new user will not be allowed to create new roles. This is the default.","names":["-R","--no-createrole"],"signature":"-R --no-createrole"},{"description":"The new user will be a superuser.","names":["-s","--superuser"],"signature":"-s --superuser"},{"description":"The new user will not be a superuser. This is the default.","names":["-S","--no-superuser"],"signature":"-S --no-superuser"},{"description":"Set a date and time after which the role's password is no longer valid. The default is to set no password expiry date.","names":["-v timestamp","--valid-until= timestamp"],"signature":"-v timestamp --valid-until= timestamp"},{"description":"Print the createuser version and exit.","names":["-V","--version"],"signature":"-V --version"},{"description":"The new user will bypass every row-level security (RLS) policy.","names":["--bypassrls"],"signature":"--bypassrls"},{"description":"The new user will not bypass row-level security (RLS) policies. This is the default.","names":["--no-bypassrls"],"signature":"--no-bypassrls"},{"description":"The new user will have the REPLICATION privilege, which is described more fully in the documentation for CREATE ROLE .","names":["--replication"],"signature":"--replication"},{"description":"The new user will not have the REPLICATION privilege, which is described more fully in the documentation for CREATE ROLE . This is the default.","names":["--no-replication"],"signature":"--no-replication"},{"description":"Show help about createuser command line arguments, and exit.","names":["-?","--help"],"signature":"-? --help"},{"description":"Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket.","names":["-h host","--host= host"],"signature":"-h host --host= host"},{"description":"Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.","names":["-p port","--port= port"],"signature":"-p port --port= port"},{"description":"User name to connect as (not the user name to create).","names":["-U username","--username= username"],"signature":"-U username --username= username"},{"description":"Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.","names":["-w","--no-password"],"signature":"-w --no-password"},{"description":"Force createuser to prompt for a password (for connecting to the server, not for the password of the new user). This option is never essential, since createuser will automatically prompt for a password if the server demands password authentication. However, createuser will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt.","names":["-W","--password"],"signature":"-W --password"}],"synopsis":["createuser [ connection-option ...] [ option ...] [ username ]"]},"comparison_hash":"a799786c932cad0cf5beb0247529a9915a47614f3c76662e3d36b4748f38780d","description":["createuser — define a new PostgreSQL user account"],"environment":[{"description":"Default connection parameters","name":"PGHOST PGPORT PGUSER"},{"description":"Specifies whether to use color in diagnostic messages. Possible values are always , auto and never .","name":"PG_COLOR"}],"facts":[{"label":"Documented executable","value":"createuser"},{"label":"Executable version","value":"18.6"},{"label":"Reference inventory","value":"Client applications"},{"label":"Option definition groups","value":"30"}],"manual_html":"\u003cdiv\u003e\u003cdiv class=\"refentry\" id=\"APP-CREATEUSER\"\u003e\n\u003cdiv class=\"titlepage\"\u003e\u003c/div\u003e\n\u003cdiv class=\"refnamediv\"\u003e\n\u003ch2\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003ecreateuser\u003c/span\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003cp\u003ecreateuser — define a new \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e user account\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsynopsisdiv\"\u003e\n\u003ch2\u003eSynopsis\u003c/h2\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.4.5.4.1\"\u003e\u003ccode class=\"command\"\u003ecreateuser\u003c/code\u003e [\u003cem class=\"replaceable\"\u003e\u003ccode\u003econnection-option\u003c/code\u003e\u003c/em\u003e...] [\u003cem class=\"replaceable\"\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e...] [\u003cem class=\"replaceable\"\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.5.5\"\u003e\n\u003ch2\u003eDescription\u003c/h2\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003ecreateuser\u003c/span\u003e creates a new \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e user (or more precisely, a role). Only superusers and users with \u003ccode class=\"literal\"\u003eCREATEROLE\u003c/code\u003e privilege can create new users, so \u003cspan class=\"application\"\u003ecreateuser\u003c/span\u003e must be invoked by someone who can connect as a superuser or a user with \u003ccode class=\"literal\"\u003eCREATEROLE\u003c/code\u003e privilege.\u003c/p\u003e\n\u003cp\u003eIf you wish to create a role with the \u003ccode class=\"literal\"\u003eSUPERUSER\u003c/code\u003e, \u003ccode class=\"literal\"\u003eREPLICATION\u003c/code\u003e, or \u003ccode class=\"literal\"\u003eBYPASSRLS\u003c/code\u003e privilege, you must connect as a superuser, not merely with \u003ccode class=\"literal\"\u003eCREATEROLE\u003c/code\u003e privilege. Being a superuser implies the ability to bypass all access permission checks within the database, so superuser access should not be granted lightly. \u003ccode class=\"literal\"\u003eCREATEROLE\u003c/code\u003e also conveys \u003ca class=\"link\" href=\"/docs/18/role-attributes.html#ROLE-CREATION\"\u003every extensive privileges\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003ecreateuser\u003c/span\u003e is a wrapper around the SQL command \u003ca class=\"link\" href=\"/docs/18/sql-createrole.html\" title=\"CREATE ROLE\"\u003e\u003ccode class=\"command\"\u003eCREATE ROLE\u003c/code\u003e\u003c/a\u003e. There is no effective difference between creating users via this utility and via other methods for accessing the server.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.5.6\"\u003e\n\u003ch2\u003eOptions\u003c/h2\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003ecreateuser\u003c/span\u003e accepts the following command-line arguments:\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the name of the \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e user to be created. This name must be different from all existing roles in this \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e installation.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-a \u003cem class=\"replaceable\"\u003e\u003ccode\u003erole\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--with-admin=\u003cem class=\"replaceable\"\u003e\u003ccode\u003erole\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies an existing role that will be automatically added as a member of the new role with admin option, giving it the right to grant membership in the new role to others. Multiple existing roles can be specified by writing multiple \u003ccode class=\"option\"\u003e-a\u003c/code\u003e switches.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-c \u003cem class=\"replaceable\"\u003e\u003ccode\u003enumber\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--connection-limit=\u003cem class=\"replaceable\"\u003e\u003ccode\u003enumber\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSet a maximum number of connections for the new user. The default is to set no limit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-d\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--createdb\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new user will be allowed to create databases.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-D\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-createdb\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new user will not be allowed to create databases. This is the default.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--echo\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eEcho the commands that \u003cspan class=\"application\"\u003ecreateuser\u003c/span\u003e generates and sends to the server.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-E\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--encrypted\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThis option is obsolete but still accepted for backward compatibility.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-g \u003cem class=\"replaceable\"\u003e\u003ccode\u003erole\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--member-of=\u003cem class=\"replaceable\"\u003e\u003ccode\u003erole\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--role=\u003cem class=\"replaceable\"\u003e\u003ccode\u003erole\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e (deprecated)\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the new role should be automatically added as a member of the specified existing role. Multiple existing roles can be specified by writing multiple \u003ccode class=\"option\"\u003e-g\u003c/code\u003e switches.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-i\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--inherit\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new role will automatically inherit privileges of roles it is a member of. This is the default.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-I\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-inherit\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new role will not automatically inherit privileges of roles it is a member of.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--interactive\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrompt for the user name if none is specified on the command line, and also prompt for whichever of the options \u003ccode class=\"option\"\u003e-d\u003c/code\u003e/\u003ccode class=\"option\"\u003e-D\u003c/code\u003e, \u003ccode class=\"option\"\u003e-r\u003c/code\u003e/\u003ccode class=\"option\"\u003e-R\u003c/code\u003e, \u003ccode class=\"option\"\u003e-s\u003c/code\u003e/\u003ccode class=\"option\"\u003e-S\u003c/code\u003e is not specified on the command line. (This was the default behavior up to PostgreSQL 9.1.)\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-l\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--login\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new user will be allowed to log in (that is, the user name can be used as the initial session user identifier). This is the default.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-L\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-login\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new user will not be allowed to log in. (A role without login privilege is still useful as a means of managing database permissions.)\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-m \u003cem class=\"replaceable\"\u003e\u003ccode\u003erole\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--with-member=\u003cem class=\"replaceable\"\u003e\u003ccode\u003erole\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies an existing role that will be automatically added as a member of the new role. Multiple existing roles can be specified by writing multiple \u003ccode class=\"option\"\u003e-m\u003c/code\u003e switches.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-P\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--pwprompt\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eIf given, \u003cspan class=\"application\"\u003ecreateuser\u003c/span\u003e will issue a prompt for the password of the new user. This is not necessary if you do not plan on using password authentication.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-r\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--createrole\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new user will be allowed to create, alter, drop, comment on, change the security label for other roles; that is, this user will have \u003ccode class=\"literal\"\u003eCREATEROLE\u003c/code\u003e privilege. See \u003ca class=\"xref\" href=\"/docs/18/role-attributes.html#ROLE-CREATION\"\u003erole creation\u003c/a\u003e for more details about what capabilities are conferred by this privilege.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-R\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-createrole\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new user will not be allowed to create new roles. This is the default.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-s\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--superuser\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new user will be a superuser.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-S\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-superuser\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new user will not be a superuser. This is the default.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-v \u003cem class=\"replaceable\"\u003e\u003ccode\u003etimestamp\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--valid-until=\u003cem class=\"replaceable\"\u003e\u003ccode\u003etimestamp\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSet a date and time after which the role's password is no longer valid. The default is to set no password expiry date.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-V\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--version\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the \u003cspan class=\"application\"\u003ecreateuser\u003c/span\u003e version and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--bypassrls\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new user will bypass every row-level security (RLS) policy.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-bypassrls\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new user will not bypass row-level security (RLS) policies. This is the default.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--replication\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new user will have the \u003ccode class=\"literal\"\u003eREPLICATION\u003c/code\u003e privilege, which is described more fully in the documentation for \u003ca class=\"xref\" href=\"/docs/18/sql-createrole.html\" title=\"CREATE ROLE\"\u003e\u003cspan class=\"refentrytitle\"\u003eCREATE ROLE\u003c/span\u003e\u003c/a\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-replication\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new user will not have the \u003ccode class=\"literal\"\u003eREPLICATION\u003c/code\u003e privilege, which is described more fully in the documentation for \u003ca class=\"xref\" href=\"/docs/18/sql-createrole.html\" title=\"CREATE ROLE\"\u003e\u003cspan class=\"refentrytitle\"\u003eCREATE ROLE\u003c/span\u003e\u003c/a\u003e. This is the default.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-?\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--help\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eShow help about \u003cspan class=\"application\"\u003ecreateuser\u003c/span\u003e command line arguments, and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003ecreateuser\u003c/span\u003e also accepts the following command-line arguments for connection parameters:\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-h \u003cem class=\"replaceable\"\u003e\u003ccode\u003ehost\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--host=\u003cem class=\"replaceable\"\u003e\u003ccode\u003ehost\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-p \u003cem class=\"replaceable\"\u003e\u003ccode\u003eport\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--port=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eport\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-U \u003cem class=\"replaceable\"\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--username=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eUser name to connect as (not the user name to create).\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-w\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-password\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eNever issue a password prompt. If the server requires password authentication and a password is not available by other means such as a \u003ccode class=\"filename\"\u003e.pgpass\u003c/code\u003e file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-W\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--password\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eForce \u003cspan class=\"application\"\u003ecreateuser\u003c/span\u003e to prompt for a password (for connecting to the server, not for the password of the new user).\u003c/p\u003e\n\u003cp\u003eThis option is never essential, since \u003cspan class=\"application\"\u003ecreateuser\u003c/span\u003e will automatically prompt for a password if the server demands password authentication. However, \u003cspan class=\"application\"\u003ecreateuser\u003c/span\u003e will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing \u003ccode class=\"option\"\u003e-W\u003c/code\u003e to avoid the extra connection attempt.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.5.7\"\u003e\n\u003ch2\u003eEnvironment\u003c/h2\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePGHOST\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePGPORT\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePGUSER\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDefault connection parameters\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePG_COLOR\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies whether to use color in diagnostic messages. Possible values are \u003ccode class=\"literal\"\u003ealways\u003c/code\u003e, \u003ccode class=\"literal\"\u003eauto\u003c/code\u003e and \u003ccode class=\"literal\"\u003enever\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eThis utility, like most other \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e utilities, also uses the environment variables supported by \u003cspan class=\"application\"\u003elibpq\u003c/span\u003e (see \u003ca class=\"xref\" href=\"/docs/18/libpq-envars.html\" title=\"32.15. Environment Variables\"\u003eSection 32.15\u003c/a\u003e).\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.5.8\"\u003e\n\u003ch2\u003eDiagnostics\u003c/h2\u003e\n\u003cp\u003eIn case of difficulty, see \u003ca class=\"xref\" href=\"/docs/18/sql-createrole.html\" title=\"CREATE ROLE\"\u003e\u003cspan class=\"refentrytitle\"\u003eCREATE ROLE\u003c/span\u003e\u003c/a\u003e and \u003ca class=\"xref\" href=\"/docs/18/app-psql.html\" title=\"psql\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epsql\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e for discussions of potential problems and error messages. The database server must be running at the targeted host. Also, any default connection settings and environment variables used by the \u003cspan class=\"application\"\u003elibpq\u003c/span\u003e front-end library will apply.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.5.9\"\u003e\n\u003ch2\u003eExamples\u003c/h2\u003e\n\u003cp\u003eTo create a user \u003ccode class=\"literal\"\u003ejoe\u003c/code\u003e on the default database server:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$ \u003c/code\u003e\u003cstrong class=\"userinput\"\u003e\u003ccode\u003ecreateuser joe\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eTo create a user \u003ccode class=\"literal\"\u003ejoe\u003c/code\u003e on the default database server with prompting for some additional attributes:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$ \u003c/code\u003e\u003cstrong class=\"userinput\"\u003e\u003ccode\u003ecreateuser --interactive joe\u003c/code\u003e\u003c/strong\u003e\n\u003ccode class=\"computeroutput\"\u003eShall the new role be a superuser? (y/n) \u003c/code\u003e\u003cstrong class=\"userinput\"\u003e\u003ccode\u003en\u003c/code\u003e\u003c/strong\u003e\n\u003ccode class=\"computeroutput\"\u003eShall the new role be allowed to create databases? (y/n) \u003c/code\u003e\u003cstrong class=\"userinput\"\u003e\u003ccode\u003en\u003c/code\u003e\u003c/strong\u003e\n\u003ccode class=\"computeroutput\"\u003eShall the new role be allowed to create more new roles? (y/n) \u003c/code\u003e\u003cstrong class=\"userinput\"\u003e\u003ccode\u003en\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eTo create the same user \u003ccode class=\"literal\"\u003ejoe\u003c/code\u003e using the server on host \u003ccode class=\"literal\"\u003eeden\u003c/code\u003e, port 5000, with attributes explicitly specified, taking a look at the underlying command:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$ \u003c/code\u003e\u003cstrong class=\"userinput\"\u003e\u003ccode\u003ecreateuser -h eden -p 5000 -S -D -R -e joe\u003c/code\u003e\u003c/strong\u003e\n\u003ccode class=\"computeroutput\"\u003eCREATE ROLE joe NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;\u003c/code\u003e\n\u003c/pre\u003e\n\u003cp\u003eTo create the user \u003ccode class=\"literal\"\u003ejoe\u003c/code\u003e as a superuser, and assign a password immediately:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$ \u003c/code\u003e\u003cstrong class=\"userinput\"\u003e\u003ccode\u003ecreateuser -P -s -e joe\u003c/code\u003e\u003c/strong\u003e\n\u003ccode class=\"computeroutput\"\u003eEnter password for new role: \u003c/code\u003e\u003cstrong class=\"userinput\"\u003e\u003ccode\u003exyzzy\u003c/code\u003e\u003c/strong\u003e\n\u003ccode class=\"computeroutput\"\u003eEnter it again: \u003c/code\u003e\u003cstrong class=\"userinput\"\u003e\u003ccode\u003exyzzy\u003c/code\u003e\u003c/strong\u003e\n\u003ccode class=\"computeroutput\"\u003eCREATE ROLE joe PASSWORD 'SCRAM-SHA-256$4096:44560wPMLfjqiAzyPDZ/eQ==$4CA054rZlSFEq8Z3FEhToBTa2X6KnWFxFkPwIbKoDe0=:L/nbSZRCjp6RhOhKK56GoR1zibCCSePKshCJ9lnl3yw=' SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN NOREPLICATION NOBYPASSRLS;\u003c/code\u003e\n\u003c/pre\u003e\n\u003cp\u003eIn the above example, the new password isn't actually echoed when typed, but we show what was typed for clarity. As you see, the password is encrypted before it is sent to the client.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.5.10\"\u003e\n\u003ch2\u003eSee Also\u003c/h2\u003e\u003cspan class=\"simplelist\"\u003e\u003ca class=\"xref\" href=\"/docs/18/app-dropuser.html\" title=\"dropuser\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003edropuser\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e, \u003ca class=\"xref\" href=\"/docs/18/sql-createrole.html\" title=\"CREATE ROLE\"\u003e\u003cspan class=\"refentrytitle\"\u003eCREATE ROLE\u003c/span\u003e\u003c/a\u003e, \u003ca class=\"xref\" href=\"/docs/18/runtime-config-client.html#GUC-CREATEROLE-SELF-GRANT\"\u003ecreaterole_self_grant\u003c/a\u003e\u003c/span\u003e\n\u003c/div\u003e\n\u003c/div\u003e\u003c/div\u003e","manual_path":"app-createuser.html","options":[{"description":"Specifies an existing role that will be automatically added as a member of the new role with admin option, giving it the right to grant membership in the new role to others. Multiple existing roles can be specified by writing multiple -a switches.","names":["-a role","--with-admin= role"],"signature":"-a role --with-admin= role","source_url":"/docs/18/app-createuser.html","summary":"Specifies an existing role that will be automatically added as a member of the new role with admin option, giving it the right to grant membership in the new role to others. Multiple existing roles can be specified by writing multiple -a switches."},{"description":"Set a maximum number of connections for the new user. The default is to set no limit.","names":["-c number","--connection-limit= number"],"signature":"-c number --connection-limit= number","source_url":"/docs/18/app-createuser.html","summary":"Set a maximum number of connections for the new user. The default is to set no limit."},{"description":"The new user will be allowed to create databases.","names":["-d","--createdb"],"signature":"-d --createdb","source_url":"/docs/18/app-createuser.html","summary":"The new user will be allowed to create databases."},{"description":"The new user will not be allowed to create databases. This is the default.","names":["-D","--no-createdb"],"signature":"-D --no-createdb","source_url":"/docs/18/app-createuser.html","summary":"The new user will not be allowed to create databases. This is the default."},{"description":"Echo the commands that createuser generates and sends to the server.","names":["-e","--echo"],"signature":"-e --echo","source_url":"/docs/18/app-createuser.html","summary":"Echo the commands that createuser generates and sends to the server."},{"description":"This option is obsolete but still accepted for backward compatibility.","names":["-E","--encrypted"],"signature":"-E --encrypted","source_url":"/docs/18/app-createuser.html","summary":"This option is obsolete but still accepted for backward compatibility."},{"description":"Specifies the new role should be automatically added as a member of the specified existing role. Multiple existing roles can be specified by writing multiple -g switches.","names":["-g role","--member-of= role","--role= role"],"signature":"-g role --member-of= role --role= role (deprecated)","source_url":"/docs/18/app-createuser.html","summary":"Specifies the new role should be automatically added as a member of the specified existing role. Multiple existing roles can be specified by writing multiple -g switches."},{"description":"The new role will automatically inherit privileges of roles it is a member of. This is the default.","names":["-i","--inherit"],"signature":"-i --inherit","source_url":"/docs/18/app-createuser.html","summary":"The new role will automatically inherit privileges of roles it is a member of. This is the default."},{"description":"The new role will not automatically inherit privileges of roles it is a member of.","names":["-I","--no-inherit"],"signature":"-I --no-inherit","source_url":"/docs/18/app-createuser.html","summary":"The new role will not automatically inherit privileges of roles it is a member of."},{"description":"Prompt for the user name if none is specified on the command line, and also prompt for whichever of the options -d / -D , -r / -R , -s / -S is not specified on the command line. (This was the default behavior up to PostgreSQL 9.1.)","names":["--interactive"],"signature":"--interactive","source_url":"/docs/18/app-createuser.html","summary":"Prompt for the user name if none is specified on the command line, and also prompt for whichever of the options -d / -D , -r / -R , -s / -S is not specified on the command line. (This was the default behavior up to PostgreSQL 9.1.)"},{"description":"The new user will be allowed to log in (that is, the user name can be used as the initial session user identifier). This is the default.","names":["-l","--login"],"signature":"-l --login","source_url":"/docs/18/app-createuser.html","summary":"The new user will be allowed to log in (that is, the user name can be used as the initial session user identifier). This is the default."},{"description":"The new user will not be allowed to log in. (A role without login privilege is still useful as a means of managing database permissions.)","names":["-L","--no-login"],"signature":"-L --no-login","source_url":"/docs/18/app-createuser.html","summary":"The new user will not be allowed to log in. (A role without login privilege is still useful as a means of managing database permissions.)"},{"description":"Specifies an existing role that will be automatically added as a member of the new role. Multiple existing roles can be specified by writing multiple -m switches.","names":["-m role","--with-member= role"],"signature":"-m role --with-member= role","source_url":"/docs/18/app-createuser.html","summary":"Specifies an existing role that will be automatically added as a member of the new role. Multiple existing roles can be specified by writing multiple -m switches."},{"description":"If given, createuser will issue a prompt for the password of the new user. This is not necessary if you do not plan on using password authentication.","names":["-P","--pwprompt"],"signature":"-P --pwprompt","source_url":"/docs/18/app-createuser.html","summary":"If given, createuser will issue a prompt for the password of the new user. This is not necessary if you do not plan on using password authentication."},{"description":"The new user will be allowed to create, alter, drop, comment on, change the security label for other roles; that is, this user will have CREATEROLE privilege. See role creation for more details about what capabilities are conferred by this privilege.","names":["-r","--createrole"],"signature":"-r --createrole","source_url":"/docs/18/app-createuser.html","summary":"The new user will be allowed to create, alter, drop, comment on, change the security label for other roles; that is, this user will have CREATEROLE privilege. See role creation for more details about what capabilities are conferred by this privilege."},{"description":"The new user will not be allowed to create new roles. This is the default.","names":["-R","--no-createrole"],"signature":"-R --no-createrole","source_url":"/docs/18/app-createuser.html","summary":"The new user will not be allowed to create new roles. This is the default."},{"description":"The new user will be a superuser.","names":["-s","--superuser"],"signature":"-s --superuser","source_url":"/docs/18/app-createuser.html","summary":"The new user will be a superuser."},{"description":"The new user will not be a superuser. This is the default.","names":["-S","--no-superuser"],"signature":"-S --no-superuser","source_url":"/docs/18/app-createuser.html","summary":"The new user will not be a superuser. This is the default."},{"description":"Set a date and time after which the role's password is no longer valid. The default is to set no password expiry date.","names":["-v timestamp","--valid-until= timestamp"],"signature":"-v timestamp --valid-until= timestamp","source_url":"/docs/18/app-createuser.html","summary":"Set a date and time after which the role's password is no longer valid. The default is to set no password expiry date."},{"description":"Print the createuser version and exit.","names":["-V","--version"],"signature":"-V --version","source_url":"/docs/18/app-createuser.html","summary":"Print the createuser version and exit."},{"description":"The new user will bypass every row-level security (RLS) policy.","names":["--bypassrls"],"signature":"--bypassrls","source_url":"/docs/18/app-createuser.html","summary":"The new user will bypass every row-level security (RLS) policy."},{"description":"The new user will not bypass row-level security (RLS) policies. This is the default.","names":["--no-bypassrls"],"signature":"--no-bypassrls","source_url":"/docs/18/app-createuser.html","summary":"The new user will not bypass row-level security (RLS) policies. This is the default."},{"description":"The new user will have the REPLICATION privilege, which is described more fully in the documentation for CREATE ROLE .","names":["--replication"],"signature":"--replication","source_url":"/docs/18/app-createuser.html","summary":"The new user will have the REPLICATION privilege, which is described more fully in the documentation for CREATE ROLE ."},{"description":"The new user will not have the REPLICATION privilege, which is described more fully in the documentation for CREATE ROLE . This is the default.","names":["--no-replication"],"signature":"--no-replication","source_url":"/docs/18/app-createuser.html","summary":"The new user will not have the REPLICATION privilege, which is described more fully in the documentation for CREATE ROLE . This is the default."},{"description":"Show help about createuser command line arguments, and exit.","names":["-?","--help"],"signature":"-? --help","source_url":"/docs/18/app-createuser.html","summary":"Show help about createuser command line arguments, and exit."},{"description":"Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket.","names":["-h host","--host= host"],"signature":"-h host --host= host","source_url":"/docs/18/app-createuser.html","summary":"Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket."},{"description":"Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.","names":["-p port","--port= port"],"signature":"-p port --port= port","source_url":"/docs/18/app-createuser.html","summary":"Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections."},{"description":"User name to connect as (not the user name to create).","names":["-U username","--username= username"],"signature":"-U username --username= username","source_url":"/docs/18/app-createuser.html","summary":"User name to connect as (not the user name to create)."},{"description":"Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.","names":["-w","--no-password"],"signature":"-w --no-password","source_url":"/docs/18/app-createuser.html","summary":"Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password."},{"description":"Force createuser to prompt for a password (for connecting to the server, not for the password of the new user). This option is never essential, since createuser will automatically prompt for a password if the server demands password authentication. However, createuser will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt.","names":["-W","--password"],"signature":"-W --password","source_url":"/docs/18/app-createuser.html","summary":"Force createuser to prompt for a password (for connecting to the server, not for the password of the new user)."}],"related":[],"release":{"channel":"stable","evidence_kind":"English manual and source declarations","label":"18.6","major":"18","manifest":{"index":"index.html","major":"18","pages":1148,"pdf":{"A4":{"built_at":"2026-09-26","bytes":15865106,"pages":3154,"sha256":"19512c405da53f9f7fcf0abba359223aa65f021be025bf3411381918f92e3190","url":"/files/documentation/pdf/18/postgresql-18-A4.pdf"},"US":{"built_at":"2026-09-26","bytes":15748059,"pages":3328,"sha256":"facbe6c229e598b872d3d98bef53308f46e06746006fa4590de9a7de9dd46319","url":"/files/documentation/pdf/18/postgresql-18-US.pdf"}},"release":"18.6","source_mode":"en SGML built with pinned official archive","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","source_url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","svg_assets":3,"tree":"18"},"ref":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","revision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"},"sections":[],"signature":"createuser [ connection-option ...] [ option ...] [ username ]","sources":[{"anchor":"","file":"app-createuser.html","label":"18.6 English manual · app-createuser.html","sha256":"32e83037eea6747b012d7ebf7c5cea18a037b940b9458ac0b13953a1f1535bd9","url":"/docs/18/app-createuser.html"},{"anchor":"","file":"reference-client.html","label":"Client applications inventory","sha256":"68f726af77272fe73a827be2b7b5958d0f2239a6f8ed44264e9d42496bfa4fd0","url":"/docs/18/reference-client.html"}],"synopsis":["createuser [ connection-option ...] [ option ...] [ username ]"],"tables":[{"columns":[{"key":"signature","label":"Option and arguments"},{"key":"summary","label":"Description"}],"key":"options","rows":[{"signature":{"text":"-a role --with-admin= role","url":"/docs/18/app-createuser.html"},"summary":"Specifies an existing role that will be automatically added as a member of the new role with admin option, giving it the right to grant membership in the new role to others. Multiple existing roles can be specified by writing multiple -a switches."},{"signature":{"text":"-c number --connection-limit= number","url":"/docs/18/app-createuser.html"},"summary":"Set a maximum number of connections for the new user. The default is to set no limit."},{"signature":{"text":"-d --createdb","url":"/docs/18/app-createuser.html"},"summary":"The new user will be allowed to create databases."},{"signature":{"text":"-D --no-createdb","url":"/docs/18/app-createuser.html"},"summary":"The new user will not be allowed to create databases. This is the default."},{"signature":{"text":"-e --echo","url":"/docs/18/app-createuser.html"},"summary":"Echo the commands that createuser generates and sends to the server."},{"signature":{"text":"-E --encrypted","url":"/docs/18/app-createuser.html"},"summary":"This option is obsolete but still accepted for backward compatibility."},{"signature":{"text":"-g role --member-of= role --role= role (deprecated)","url":"/docs/18/app-createuser.html"},"summary":"Specifies the new role should be automatically added as a member of the specified existing role. Multiple existing roles can be specified by writing multiple -g switches."},{"signature":{"text":"-i --inherit","url":"/docs/18/app-createuser.html"},"summary":"The new role will automatically inherit privileges of roles it is a member of. This is the default."},{"signature":{"text":"-I --no-inherit","url":"/docs/18/app-createuser.html"},"summary":"The new role will not automatically inherit privileges of roles it is a member of."},{"signature":{"text":"--interactive","url":"/docs/18/app-createuser.html"},"summary":"Prompt for the user name if none is specified on the command line, and also prompt for whichever of the options -d / -D , -r / -R , -s / -S is not specified on the command line. (This was the default behavior up to PostgreSQL 9.1.)"},{"signature":{"text":"-l --login","url":"/docs/18/app-createuser.html"},"summary":"The new user will be allowed to log in (that is, the user name can be used as the initial session user identifier). This is the default."},{"signature":{"text":"-L --no-login","url":"/docs/18/app-createuser.html"},"summary":"The new user will not be allowed to log in. (A role without login privilege is still useful as a means of managing database permissions.)"},{"signature":{"text":"-m role --with-member= role","url":"/docs/18/app-createuser.html"},"summary":"Specifies an existing role that will be automatically added as a member of the new role. Multiple existing roles can be specified by writing multiple -m switches."},{"signature":{"text":"-P --pwprompt","url":"/docs/18/app-createuser.html"},"summary":"If given, createuser will issue a prompt for the password of the new user. This is not necessary if you do not plan on using password authentication."},{"signature":{"text":"-r --createrole","url":"/docs/18/app-createuser.html"},"summary":"The new user will be allowed to create, alter, drop, comment on, change the security label for other roles; that is, this user will have CREATEROLE privilege. See role creation for more details about what capabilities are conferred by this privilege."},{"signature":{"text":"-R --no-createrole","url":"/docs/18/app-createuser.html"},"summary":"The new user will not be allowed to create new roles. This is the default."},{"signature":{"text":"-s --superuser","url":"/docs/18/app-createuser.html"},"summary":"The new user will be a superuser."},{"signature":{"text":"-S --no-superuser","url":"/docs/18/app-createuser.html"},"summary":"The new user will not be a superuser. This is the default."},{"signature":{"text":"-v timestamp --valid-until= timestamp","url":"/docs/18/app-createuser.html"},"summary":"Set a date and time after which the role's password is no longer valid. The default is to set no password expiry date."},{"signature":{"text":"-V --version","url":"/docs/18/app-createuser.html"},"summary":"Print the createuser version and exit."},{"signature":{"text":"--bypassrls","url":"/docs/18/app-createuser.html"},"summary":"The new user will bypass every row-level security (RLS) policy."},{"signature":{"text":"--no-bypassrls","url":"/docs/18/app-createuser.html"},"summary":"The new user will not bypass row-level security (RLS) policies. This is the default."},{"signature":{"text":"--replication","url":"/docs/18/app-createuser.html"},"summary":"The new user will have the REPLICATION privilege, which is described more fully in the documentation for CREATE ROLE ."},{"signature":{"text":"--no-replication","url":"/docs/18/app-createuser.html"},"summary":"The new user will not have the REPLICATION privilege, which is described more fully in the documentation for CREATE ROLE . This is the default."},{"signature":{"text":"-? --help","url":"/docs/18/app-createuser.html"},"summary":"Show help about createuser command line arguments, and exit."},{"signature":{"text":"-h host --host= host","url":"/docs/18/app-createuser.html"},"summary":"Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket."},{"signature":{"text":"-p port --port= port","url":"/docs/18/app-createuser.html"},"summary":"Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections."},{"signature":{"text":"-U username --username= username","url":"/docs/18/app-createuser.html"},"summary":"User name to connect as (not the user name to create)."},{"signature":{"text":"-w --no-password","url":"/docs/18/app-createuser.html"},"summary":"Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password."},{"signature":{"text":"-W --password","url":"/docs/18/app-createuser.html"},"summary":"Force createuser to prompt for a password (for connecting to the server, not for the password of the new user)."}],"title":"Documented options"},{"columns":[{"key":"name","label":"Variable"},{"key":"description","label":"Meaning"}],"key":"environment","rows":[{"description":"Default connection parameters","name":"PGHOST PGPORT PGUSER"},{"description":"Specifies whether to use color in diagnostic messages. Possible values are always , auto and never .","name":"PG_COLOR"}],"title":"Environment variables"}]},"ManualEvidence":{"manual_path":"app-createuser.html","release":{"channel":"stable","evidence_kind":"English manual and source declarations","label":"18.6","major":"18","manifest":{"index":"index.html","major":"18","pages":1148,"pdf":{"A4":{"built_at":"2026-09-26","bytes":15865106,"pages":3154,"sha256":"19512c405da53f9f7fcf0abba359223aa65f021be025bf3411381918f92e3190","url":"/files/documentation/pdf/18/postgresql-18-A4.pdf"},"US":{"built_at":"2026-09-26","bytes":15748059,"pages":3328,"sha256":"facbe6c229e598b872d3d98bef53308f46e06746006fa4590de9a7de9dd46319","url":"/files/documentation/pdf/18/postgresql-18-US.pdf"}},"release":"18.6","source_mode":"en SGML built with pinned official archive","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","source_url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","svg_assets":3,"tree":"18"},"ref":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","revision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"},"sources":[{"anchor":"","file":"app-createuser.html","label":"18.6 English manual · app-createuser.html","sha256":"32e83037eea6747b012d7ebf7c5cea18a037b940b9458ac0b13953a1f1535bd9","url":"/docs/18/app-createuser.html"},{"anchor":"","file":"reference-client.html","label":"Client applications inventory","sha256":"68f726af77272fe73a827be2b7b5958d0f2239a6f8ed44264e9d42496bfa4fd0","url":"/docs/18/reference-client.html"}]},"MeasuredEvidence":{}},"Text":{"Collection":"tool","Key":"createuser","SourceDatabase":"center","Version":"18","Locale":"en","Title":"createuser","Summary":"createuser — define a new PostgreSQL user account","BodyHTML":"\u003cdiv\u003e\u003cdiv id=\"APP-CREATEUSER\"\u003e\n\u003cdiv\u003e\u003c/div\u003e\n\u003cdiv\u003e\n\u003ch2\u003e\u003cspan\u003e\u003cspan\u003ecreateuser\u003c/span\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003cp\u003ecreateuser — define a new \u003cspan\u003ePostgreSQL\u003c/span\u003e user account\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv\u003e\n\u003ch2\u003eSynopsis\u003c/h2\u003e\n\u003cdiv\u003e\n\u003cp id=\"id-1.9.4.5.4.1\"\u003e\u003ccode\u003ecreateuser\u003c/code\u003e [\u003cem\u003e\u003ccode\u003econnection-option\u003c/code\u003e\u003c/em\u003e...] [\u003cem\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e...] [\u003cem\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.4.5.5\"\u003e\n\u003ch2\u003eDescription\u003c/h2\u003e\n\u003cp\u003e\u003cspan\u003ecreateuser\u003c/span\u003e creates a new \u003cspan\u003ePostgreSQL\u003c/span\u003e user (or more precisely, a role). Only superusers and users with \u003ccode\u003eCREATEROLE\u003c/code\u003e privilege can create new users, so \u003cspan\u003ecreateuser\u003c/span\u003e must be invoked by someone who can connect as a superuser or a user with \u003ccode\u003eCREATEROLE\u003c/code\u003e privilege.\u003c/p\u003e\n\u003cp\u003eIf you wish to create a role with the \u003ccode\u003eSUPERUSER\u003c/code\u003e, \u003ccode\u003eREPLICATION\u003c/code\u003e, or \u003ccode\u003eBYPASSRLS\u003c/code\u003e privilege, you must connect as a superuser, not merely with \u003ccode\u003eCREATEROLE\u003c/code\u003e privilege. Being a superuser implies the ability to bypass all access permission checks within the database, so superuser access should not be granted lightly. \u003ccode\u003eCREATEROLE\u003c/code\u003e also conveys \u003ca href=\"/docs/18/role-attributes.html#ROLE-CREATION\" rel=\"nofollow\"\u003every extensive privileges\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003e\u003cspan\u003ecreateuser\u003c/span\u003e is a wrapper around the SQL command \u003ca href=\"/docs/18/sql-createrole.html\" title=\"CREATE ROLE\" rel=\"nofollow\"\u003e\u003ccode\u003eCREATE ROLE\u003c/code\u003e\u003c/a\u003e. There is no effective difference between creating users via this utility and via other methods for accessing the server.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.4.5.6\"\u003e\n\u003ch2\u003eOptions\u003c/h2\u003e\n\u003cp\u003e\u003cspan\u003ecreateuser\u003c/span\u003e accepts the following command-line arguments:\u003c/p\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003e\u003cem\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the name of the \u003cspan\u003ePostgreSQL\u003c/span\u003e user to be created. This name must be different from all existing roles in this \u003cspan\u003ePostgreSQL\u003c/span\u003e installation.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-a \u003cem\u003e\u003ccode\u003erole\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--with-admin=\u003cem\u003e\u003ccode\u003erole\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies an existing role that will be automatically added as a member of the new role with admin option, giving it the right to grant membership in the new role to others. Multiple existing roles can be specified by writing multiple \u003ccode\u003e-a\u003c/code\u003e switches.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-c \u003cem\u003e\u003ccode\u003enumber\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--connection-limit=\u003cem\u003e\u003ccode\u003enumber\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSet a maximum number of connections for the new user. The default is to set no limit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-d\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--createdb\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new user will be allowed to create databases.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-D\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--no-createdb\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new user will not be allowed to create databases. This is the default.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--echo\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eEcho the commands that \u003cspan\u003ecreateuser\u003c/span\u003e generates and sends to the server.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-E\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--encrypted\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThis option is obsolete but still accepted for backward compatibility.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-g \u003cem\u003e\u003ccode\u003erole\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--member-of=\u003cem\u003e\u003ccode\u003erole\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--role=\u003cem\u003e\u003ccode\u003erole\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e (deprecated)\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the new role should be automatically added as a member of the specified existing role. Multiple existing roles can be specified by writing multiple \u003ccode\u003e-g\u003c/code\u003e switches.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-i\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--inherit\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new role will automatically inherit privileges of roles it is a member of. This is the default.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-I\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--no-inherit\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new role will not automatically inherit privileges of roles it is a member of.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--interactive\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrompt for the user name if none is specified on the command line, and also prompt for whichever of the options \u003ccode\u003e-d\u003c/code\u003e/\u003ccode\u003e-D\u003c/code\u003e, \u003ccode\u003e-r\u003c/code\u003e/\u003ccode\u003e-R\u003c/code\u003e, \u003ccode\u003e-s\u003c/code\u003e/\u003ccode\u003e-S\u003c/code\u003e is not specified on the command line. (This was the default behavior up to PostgreSQL 9.1.)\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-l\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--login\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new user will be allowed to log in (that is, the user name can be used as the initial session user identifier). This is the default.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-L\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--no-login\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new user will not be allowed to log in. (A role without login privilege is still useful as a means of managing database permissions.)\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-m \u003cem\u003e\u003ccode\u003erole\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--with-member=\u003cem\u003e\u003ccode\u003erole\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies an existing role that will be automatically added as a member of the new role. Multiple existing roles can be specified by writing multiple \u003ccode\u003e-m\u003c/code\u003e switches.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-P\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--pwprompt\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eIf given, \u003cspan\u003ecreateuser\u003c/span\u003e will issue a prompt for the password of the new user. This is not necessary if you do not plan on using password authentication.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-r\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--createrole\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new user will be allowed to create, alter, drop, comment on, change the security label for other roles; that is, this user will have \u003ccode\u003eCREATEROLE\u003c/code\u003e privilege. See \u003ca href=\"/docs/18/role-attributes.html#ROLE-CREATION\" rel=\"nofollow\"\u003erole creation\u003c/a\u003e for more details about what capabilities are conferred by this privilege.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-R\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--no-createrole\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new user will not be allowed to create new roles. This is the default.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-s\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--superuser\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new user will be a superuser.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-S\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--no-superuser\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new user will not be a superuser. This is the default.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-v \u003cem\u003e\u003ccode\u003etimestamp\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--valid-until=\u003cem\u003e\u003ccode\u003etimestamp\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSet a date and time after which the role\u0026#39;s password is no longer valid. The default is to set no password expiry date.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-V\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--version\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the \u003cspan\u003ecreateuser\u003c/span\u003e version and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--bypassrls\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new user will bypass every row-level security (RLS) policy.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--no-bypassrls\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new user will not bypass row-level security (RLS) policies. This is the default.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--replication\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new user will have the \u003ccode\u003eREPLICATION\u003c/code\u003e privilege, which is described more fully in the documentation for \u003ca href=\"/docs/18/sql-createrole.html\" title=\"CREATE ROLE\" rel=\"nofollow\"\u003e\u003cspan\u003eCREATE ROLE\u003c/span\u003e\u003c/a\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--no-replication\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new user will not have the \u003ccode\u003eREPLICATION\u003c/code\u003e privilege, which is described more fully in the documentation for \u003ca href=\"/docs/18/sql-createrole.html\" title=\"CREATE ROLE\" rel=\"nofollow\"\u003e\u003cspan\u003eCREATE ROLE\u003c/span\u003e\u003c/a\u003e. This is the default.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-?\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--help\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eShow help about \u003cspan\u003ecreateuser\u003c/span\u003e command line arguments, and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003e\u003cspan\u003ecreateuser\u003c/span\u003e also accepts the following command-line arguments for connection parameters:\u003c/p\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-h \u003cem\u003e\u003ccode\u003ehost\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--host=\u003cem\u003e\u003ccode\u003ehost\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-p \u003cem\u003e\u003ccode\u003eport\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--port=\u003cem\u003e\u003ccode\u003eport\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-U \u003cem\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--username=\u003cem\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eUser name to connect as (not the user name to create).\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-w\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--no-password\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eNever issue a password prompt. If the server requires password authentication and a password is not available by other means such as a \u003ccode\u003e.pgpass\u003c/code\u003e file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-W\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--password\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eForce \u003cspan\u003ecreateuser\u003c/span\u003e to prompt for a password (for connecting to the server, not for the password of the new user).\u003c/p\u003e\n\u003cp\u003eThis option is never essential, since \u003cspan\u003ecreateuser\u003c/span\u003e will automatically prompt for a password if the server demands password authentication. However, \u003cspan\u003ecreateuser\u003c/span\u003e will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing \u003ccode\u003e-W\u003c/code\u003e to avoid the extra connection attempt.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.4.5.7\"\u003e\n\u003ch2\u003eEnvironment\u003c/h2\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003ePGHOST\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003ePGPORT\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003ePGUSER\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDefault connection parameters\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003ePG_COLOR\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies whether to use color in diagnostic messages. Possible values are \u003ccode\u003ealways\u003c/code\u003e, \u003ccode\u003eauto\u003c/code\u003e and \u003ccode\u003enever\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eThis utility, like most other \u003cspan\u003ePostgreSQL\u003c/span\u003e utilities, also uses the environment variables supported by \u003cspan\u003elibpq\u003c/span\u003e (see \u003ca href=\"/docs/18/libpq-envars.html\" rel=\"nofollow\"\u003eSection 32.15\u003c/a\u003e).\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.4.5.8\"\u003e\n\u003ch2\u003eDiagnostics\u003c/h2\u003e\n\u003cp\u003eIn case of difficulty, see \u003ca href=\"/docs/18/sql-createrole.html\" title=\"CREATE ROLE\" rel=\"nofollow\"\u003e\u003cspan\u003eCREATE ROLE\u003c/span\u003e\u003c/a\u003e and \u003ca href=\"/docs/18/app-psql.html\" title=\"psql\" rel=\"nofollow\"\u003e\u003cspan\u003e\u003cspan\u003epsql\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e for discussions of potential problems and error messages. The database server must be running at the targeted host. Also, any default connection settings and environment variables used by the \u003cspan\u003elibpq\u003c/span\u003e front-end library will apply.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.4.5.9\"\u003e\n\u003ch2\u003eExamples\u003c/h2\u003e\n\u003cp\u003eTo create a user \u003ccode\u003ejoe\u003c/code\u003e on the default database server:\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003e$ \u003c/code\u003e\u003cstrong\u003e\u003ccode\u003ecreateuser joe\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eTo create a user \u003ccode\u003ejoe\u003c/code\u003e on the default database server with prompting for some additional attributes:\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003e$ \u003c/code\u003e\u003cstrong\u003e\u003ccode\u003ecreateuser --interactive joe\u003c/code\u003e\u003c/strong\u003e\n\u003ccode\u003eShall the new role be a superuser? (y/n) \u003c/code\u003e\u003cstrong\u003e\u003ccode\u003en\u003c/code\u003e\u003c/strong\u003e\n\u003ccode\u003eShall the new role be allowed to create databases? (y/n) \u003c/code\u003e\u003cstrong\u003e\u003ccode\u003en\u003c/code\u003e\u003c/strong\u003e\n\u003ccode\u003eShall the new role be allowed to create more new roles? (y/n) \u003c/code\u003e\u003cstrong\u003e\u003ccode\u003en\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eTo create the same user \u003ccode\u003ejoe\u003c/code\u003e using the server on host \u003ccode\u003eeden\u003c/code\u003e, port 5000, with attributes explicitly specified, taking a look at the underlying command:\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003e$ \u003c/code\u003e\u003cstrong\u003e\u003ccode\u003ecreateuser -h eden -p 5000 -S -D -R -e joe\u003c/code\u003e\u003c/strong\u003e\n\u003ccode\u003eCREATE ROLE joe NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;\u003c/code\u003e\n\u003c/pre\u003e\n\u003cp\u003eTo create the user \u003ccode\u003ejoe\u003c/code\u003e as a superuser, and assign a password immediately:\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003e$ \u003c/code\u003e\u003cstrong\u003e\u003ccode\u003ecreateuser -P -s -e joe\u003c/code\u003e\u003c/strong\u003e\n\u003ccode\u003eEnter password for new role: \u003c/code\u003e\u003cstrong\u003e\u003ccode\u003exyzzy\u003c/code\u003e\u003c/strong\u003e\n\u003ccode\u003eEnter it again: \u003c/code\u003e\u003cstrong\u003e\u003ccode\u003exyzzy\u003c/code\u003e\u003c/strong\u003e\n\u003ccode\u003eCREATE ROLE joe PASSWORD \u0026#39;SCRAM-SHA-256$4096:44560wPMLfjqiAzyPDZ/eQ==$4CA054rZlSFEq8Z3FEhToBTa2X6KnWFxFkPwIbKoDe0=:L/nbSZRCjp6RhOhKK56GoR1zibCCSePKshCJ9lnl3yw=\u0026#39; SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN NOREPLICATION NOBYPASSRLS;\u003c/code\u003e\n\u003c/pre\u003e\n\u003cp\u003eIn the above example, the new password isn\u0026#39;t actually echoed when typed, but we show what was typed for clarity. As you see, the password is encrypted before it is sent to the client.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.4.5.10\"\u003e\n\u003ch2\u003eSee Also\u003c/h2\u003e\u003cspan\u003e\u003ca href=\"/docs/18/app-dropuser.html\" title=\"dropuser\" rel=\"nofollow\"\u003e\u003cspan\u003e\u003cspan\u003edropuser\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/docs/18/sql-createrole.html\" title=\"CREATE ROLE\" rel=\"nofollow\"\u003e\u003cspan\u003eCREATE ROLE\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/docs/18/runtime-config-client.html#GUC-CREATEROLE-SELF-GRANT\" rel=\"nofollow\"\u003ecreaterole_self_grant\u003c/a\u003e\u003c/span\u003e\n\u003c/div\u003e\n\u003c/div\u003e\u003c/div\u003e","SourceRevision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","ContentHash":"34b0355edf48f44e69d4ecde14f68d6ec500aa64bc356bcd22256dd8b6ba7c06","Payload":{"description":["createuser — define a new PostgreSQL user account"],"manual_html":"\u003cdiv\u003e\u003cdiv class=\"refentry\" id=\"APP-CREATEUSER\"\u003e\n\u003cdiv class=\"titlepage\"\u003e\u003c/div\u003e\n\u003cdiv class=\"refnamediv\"\u003e\n\u003ch2\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003ecreateuser\u003c/span\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003cp\u003ecreateuser — define a new \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e user account\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsynopsisdiv\"\u003e\n\u003ch2\u003eSynopsis\u003c/h2\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.4.5.4.1\"\u003e\u003ccode class=\"command\"\u003ecreateuser\u003c/code\u003e [\u003cem class=\"replaceable\"\u003e\u003ccode\u003econnection-option\u003c/code\u003e\u003c/em\u003e...] [\u003cem class=\"replaceable\"\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e...] [\u003cem class=\"replaceable\"\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.5.5\"\u003e\n\u003ch2\u003eDescription\u003c/h2\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003ecreateuser\u003c/span\u003e creates a new \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e user (or more precisely, a role). Only superusers and users with \u003ccode class=\"literal\"\u003eCREATEROLE\u003c/code\u003e privilege can create new users, so \u003cspan class=\"application\"\u003ecreateuser\u003c/span\u003e must be invoked by someone who can connect as a superuser or a user with \u003ccode class=\"literal\"\u003eCREATEROLE\u003c/code\u003e privilege.\u003c/p\u003e\n\u003cp\u003eIf you wish to create a role with the \u003ccode class=\"literal\"\u003eSUPERUSER\u003c/code\u003e, \u003ccode class=\"literal\"\u003eREPLICATION\u003c/code\u003e, or \u003ccode class=\"literal\"\u003eBYPASSRLS\u003c/code\u003e privilege, you must connect as a superuser, not merely with \u003ccode class=\"literal\"\u003eCREATEROLE\u003c/code\u003e privilege. Being a superuser implies the ability to bypass all access permission checks within the database, so superuser access should not be granted lightly. \u003ccode class=\"literal\"\u003eCREATEROLE\u003c/code\u003e also conveys \u003ca class=\"link\" href=\"/docs/18/role-attributes.html#ROLE-CREATION\"\u003every extensive privileges\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003ecreateuser\u003c/span\u003e is a wrapper around the SQL command \u003ca class=\"link\" href=\"/docs/18/sql-createrole.html\" title=\"CREATE ROLE\"\u003e\u003ccode class=\"command\"\u003eCREATE ROLE\u003c/code\u003e\u003c/a\u003e. There is no effective difference between creating users via this utility and via other methods for accessing the server.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.5.6\"\u003e\n\u003ch2\u003eOptions\u003c/h2\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003ecreateuser\u003c/span\u003e accepts the following command-line arguments:\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the name of the \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e user to be created. This name must be different from all existing roles in this \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e installation.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-a \u003cem class=\"replaceable\"\u003e\u003ccode\u003erole\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--with-admin=\u003cem class=\"replaceable\"\u003e\u003ccode\u003erole\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies an existing role that will be automatically added as a member of the new role with admin option, giving it the right to grant membership in the new role to others. Multiple existing roles can be specified by writing multiple \u003ccode class=\"option\"\u003e-a\u003c/code\u003e switches.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-c \u003cem class=\"replaceable\"\u003e\u003ccode\u003enumber\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--connection-limit=\u003cem class=\"replaceable\"\u003e\u003ccode\u003enumber\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSet a maximum number of connections for the new user. The default is to set no limit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-d\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--createdb\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new user will be allowed to create databases.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-D\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-createdb\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new user will not be allowed to create databases. This is the default.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--echo\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eEcho the commands that \u003cspan class=\"application\"\u003ecreateuser\u003c/span\u003e generates and sends to the server.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-E\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--encrypted\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThis option is obsolete but still accepted for backward compatibility.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-g \u003cem class=\"replaceable\"\u003e\u003ccode\u003erole\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--member-of=\u003cem class=\"replaceable\"\u003e\u003ccode\u003erole\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--role=\u003cem class=\"replaceable\"\u003e\u003ccode\u003erole\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e (deprecated)\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the new role should be automatically added as a member of the specified existing role. Multiple existing roles can be specified by writing multiple \u003ccode class=\"option\"\u003e-g\u003c/code\u003e switches.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-i\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--inherit\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new role will automatically inherit privileges of roles it is a member of. This is the default.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-I\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-inherit\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new role will not automatically inherit privileges of roles it is a member of.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--interactive\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrompt for the user name if none is specified on the command line, and also prompt for whichever of the options \u003ccode class=\"option\"\u003e-d\u003c/code\u003e/\u003ccode class=\"option\"\u003e-D\u003c/code\u003e, \u003ccode class=\"option\"\u003e-r\u003c/code\u003e/\u003ccode class=\"option\"\u003e-R\u003c/code\u003e, \u003ccode class=\"option\"\u003e-s\u003c/code\u003e/\u003ccode class=\"option\"\u003e-S\u003c/code\u003e is not specified on the command line. (This was the default behavior up to PostgreSQL 9.1.)\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-l\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--login\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new user will be allowed to log in (that is, the user name can be used as the initial session user identifier). This is the default.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-L\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-login\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new user will not be allowed to log in. (A role without login privilege is still useful as a means of managing database permissions.)\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-m \u003cem class=\"replaceable\"\u003e\u003ccode\u003erole\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--with-member=\u003cem class=\"replaceable\"\u003e\u003ccode\u003erole\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies an existing role that will be automatically added as a member of the new role. Multiple existing roles can be specified by writing multiple \u003ccode class=\"option\"\u003e-m\u003c/code\u003e switches.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-P\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--pwprompt\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eIf given, \u003cspan class=\"application\"\u003ecreateuser\u003c/span\u003e will issue a prompt for the password of the new user. This is not necessary if you do not plan on using password authentication.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-r\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--createrole\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new user will be allowed to create, alter, drop, comment on, change the security label for other roles; that is, this user will have \u003ccode class=\"literal\"\u003eCREATEROLE\u003c/code\u003e privilege. See \u003ca class=\"xref\" href=\"/docs/18/role-attributes.html#ROLE-CREATION\"\u003erole creation\u003c/a\u003e for more details about what capabilities are conferred by this privilege.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-R\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-createrole\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new user will not be allowed to create new roles. This is the default.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-s\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--superuser\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new user will be a superuser.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-S\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-superuser\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new user will not be a superuser. This is the default.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-v \u003cem class=\"replaceable\"\u003e\u003ccode\u003etimestamp\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--valid-until=\u003cem class=\"replaceable\"\u003e\u003ccode\u003etimestamp\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSet a date and time after which the role's password is no longer valid. The default is to set no password expiry date.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-V\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--version\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the \u003cspan class=\"application\"\u003ecreateuser\u003c/span\u003e version and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--bypassrls\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new user will bypass every row-level security (RLS) policy.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-bypassrls\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new user will not bypass row-level security (RLS) policies. This is the default.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--replication\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new user will have the \u003ccode class=\"literal\"\u003eREPLICATION\u003c/code\u003e privilege, which is described more fully in the documentation for \u003ca class=\"xref\" href=\"/docs/18/sql-createrole.html\" title=\"CREATE ROLE\"\u003e\u003cspan class=\"refentrytitle\"\u003eCREATE ROLE\u003c/span\u003e\u003c/a\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-replication\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe new user will not have the \u003ccode class=\"literal\"\u003eREPLICATION\u003c/code\u003e privilege, which is described more fully in the documentation for \u003ca class=\"xref\" href=\"/docs/18/sql-createrole.html\" title=\"CREATE ROLE\"\u003e\u003cspan class=\"refentrytitle\"\u003eCREATE ROLE\u003c/span\u003e\u003c/a\u003e. This is the default.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-?\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--help\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eShow help about \u003cspan class=\"application\"\u003ecreateuser\u003c/span\u003e command line arguments, and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003ecreateuser\u003c/span\u003e also accepts the following command-line arguments for connection parameters:\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-h \u003cem class=\"replaceable\"\u003e\u003ccode\u003ehost\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--host=\u003cem class=\"replaceable\"\u003e\u003ccode\u003ehost\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-p \u003cem class=\"replaceable\"\u003e\u003ccode\u003eport\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--port=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eport\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-U \u003cem class=\"replaceable\"\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--username=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eUser name to connect as (not the user name to create).\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-w\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-password\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eNever issue a password prompt. If the server requires password authentication and a password is not available by other means such as a \u003ccode class=\"filename\"\u003e.pgpass\u003c/code\u003e file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-W\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--password\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eForce \u003cspan class=\"application\"\u003ecreateuser\u003c/span\u003e to prompt for a password (for connecting to the server, not for the password of the new user).\u003c/p\u003e\n\u003cp\u003eThis option is never essential, since \u003cspan class=\"application\"\u003ecreateuser\u003c/span\u003e will automatically prompt for a password if the server demands password authentication. However, \u003cspan class=\"application\"\u003ecreateuser\u003c/span\u003e will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing \u003ccode class=\"option\"\u003e-W\u003c/code\u003e to avoid the extra connection attempt.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.5.7\"\u003e\n\u003ch2\u003eEnvironment\u003c/h2\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePGHOST\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePGPORT\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePGUSER\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDefault connection parameters\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePG_COLOR\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies whether to use color in diagnostic messages. Possible values are \u003ccode class=\"literal\"\u003ealways\u003c/code\u003e, \u003ccode class=\"literal\"\u003eauto\u003c/code\u003e and \u003ccode class=\"literal\"\u003enever\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eThis utility, like most other \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e utilities, also uses the environment variables supported by \u003cspan class=\"application\"\u003elibpq\u003c/span\u003e (see \u003ca class=\"xref\" href=\"/docs/18/libpq-envars.html\" title=\"32.15. Environment Variables\"\u003eSection 32.15\u003c/a\u003e).\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.5.8\"\u003e\n\u003ch2\u003eDiagnostics\u003c/h2\u003e\n\u003cp\u003eIn case of difficulty, see \u003ca class=\"xref\" href=\"/docs/18/sql-createrole.html\" title=\"CREATE ROLE\"\u003e\u003cspan class=\"refentrytitle\"\u003eCREATE ROLE\u003c/span\u003e\u003c/a\u003e and \u003ca class=\"xref\" href=\"/docs/18/app-psql.html\" title=\"psql\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epsql\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e for discussions of potential problems and error messages. The database server must be running at the targeted host. Also, any default connection settings and environment variables used by the \u003cspan class=\"application\"\u003elibpq\u003c/span\u003e front-end library will apply.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.5.9\"\u003e\n\u003ch2\u003eExamples\u003c/h2\u003e\n\u003cp\u003eTo create a user \u003ccode class=\"literal\"\u003ejoe\u003c/code\u003e on the default database server:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$ \u003c/code\u003e\u003cstrong class=\"userinput\"\u003e\u003ccode\u003ecreateuser joe\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eTo create a user \u003ccode class=\"literal\"\u003ejoe\u003c/code\u003e on the default database server with prompting for some additional attributes:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$ \u003c/code\u003e\u003cstrong class=\"userinput\"\u003e\u003ccode\u003ecreateuser --interactive joe\u003c/code\u003e\u003c/strong\u003e\n\u003ccode class=\"computeroutput\"\u003eShall the new role be a superuser? (y/n) \u003c/code\u003e\u003cstrong class=\"userinput\"\u003e\u003ccode\u003en\u003c/code\u003e\u003c/strong\u003e\n\u003ccode class=\"computeroutput\"\u003eShall the new role be allowed to create databases? (y/n) \u003c/code\u003e\u003cstrong class=\"userinput\"\u003e\u003ccode\u003en\u003c/code\u003e\u003c/strong\u003e\n\u003ccode class=\"computeroutput\"\u003eShall the new role be allowed to create more new roles? (y/n) \u003c/code\u003e\u003cstrong class=\"userinput\"\u003e\u003ccode\u003en\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eTo create the same user \u003ccode class=\"literal\"\u003ejoe\u003c/code\u003e using the server on host \u003ccode class=\"literal\"\u003eeden\u003c/code\u003e, port 5000, with attributes explicitly specified, taking a look at the underlying command:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$ \u003c/code\u003e\u003cstrong class=\"userinput\"\u003e\u003ccode\u003ecreateuser -h eden -p 5000 -S -D -R -e joe\u003c/code\u003e\u003c/strong\u003e\n\u003ccode class=\"computeroutput\"\u003eCREATE ROLE joe NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;\u003c/code\u003e\n\u003c/pre\u003e\n\u003cp\u003eTo create the user \u003ccode class=\"literal\"\u003ejoe\u003c/code\u003e as a superuser, and assign a password immediately:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$ \u003c/code\u003e\u003cstrong class=\"userinput\"\u003e\u003ccode\u003ecreateuser -P -s -e joe\u003c/code\u003e\u003c/strong\u003e\n\u003ccode class=\"computeroutput\"\u003eEnter password for new role: \u003c/code\u003e\u003cstrong class=\"userinput\"\u003e\u003ccode\u003exyzzy\u003c/code\u003e\u003c/strong\u003e\n\u003ccode class=\"computeroutput\"\u003eEnter it again: \u003c/code\u003e\u003cstrong class=\"userinput\"\u003e\u003ccode\u003exyzzy\u003c/code\u003e\u003c/strong\u003e\n\u003ccode class=\"computeroutput\"\u003eCREATE ROLE joe PASSWORD 'SCRAM-SHA-256$4096:44560wPMLfjqiAzyPDZ/eQ==$4CA054rZlSFEq8Z3FEhToBTa2X6KnWFxFkPwIbKoDe0=:L/nbSZRCjp6RhOhKK56GoR1zibCCSePKshCJ9lnl3yw=' SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN NOREPLICATION NOBYPASSRLS;\u003c/code\u003e\n\u003c/pre\u003e\n\u003cp\u003eIn the above example, the new password isn't actually echoed when typed, but we show what was typed for clarity. As you see, the password is encrypted before it is sent to the client.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.5.10\"\u003e\n\u003ch2\u003eSee Also\u003c/h2\u003e\u003cspan class=\"simplelist\"\u003e\u003ca class=\"xref\" href=\"/docs/18/app-dropuser.html\" title=\"dropuser\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003edropuser\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e, \u003ca class=\"xref\" href=\"/docs/18/sql-createrole.html\" title=\"CREATE ROLE\"\u003e\u003cspan class=\"refentrytitle\"\u003eCREATE ROLE\u003c/span\u003e\u003c/a\u003e, \u003ca class=\"xref\" href=\"/docs/18/runtime-config-client.html#GUC-CREATEROLE-SELF-GRANT\"\u003ecreaterole_self_grant\u003c/a\u003e\u003c/span\u003e\n\u003c/div\u003e\n\u003c/div\u003e\u003c/div\u003e","related":[],"sections":[],"tables":[{"columns":[{"key":"signature","label":"Option and arguments"},{"key":"summary","label":"Description"}],"key":"options","rows":[{"signature":{"text":"-a role --with-admin= role","url":"/docs/18/app-createuser.html"},"summary":"Specifies an existing role that will be automatically added as a member of the new role with admin option, giving it the right to grant membership in the new role to others. Multiple existing roles can be specified by writing multiple -a switches."},{"signature":{"text":"-c number --connection-limit= number","url":"/docs/18/app-createuser.html"},"summary":"Set a maximum number of connections for the new user. The default is to set no limit."},{"signature":{"text":"-d --createdb","url":"/docs/18/app-createuser.html"},"summary":"The new user will be allowed to create databases."},{"signature":{"text":"-D --no-createdb","url":"/docs/18/app-createuser.html"},"summary":"The new user will not be allowed to create databases. This is the default."},{"signature":{"text":"-e --echo","url":"/docs/18/app-createuser.html"},"summary":"Echo the commands that createuser generates and sends to the server."},{"signature":{"text":"-E --encrypted","url":"/docs/18/app-createuser.html"},"summary":"This option is obsolete but still accepted for backward compatibility."},{"signature":{"text":"-g role --member-of= role --role= role (deprecated)","url":"/docs/18/app-createuser.html"},"summary":"Specifies the new role should be automatically added as a member of the specified existing role. Multiple existing roles can be specified by writing multiple -g switches."},{"signature":{"text":"-i --inherit","url":"/docs/18/app-createuser.html"},"summary":"The new role will automatically inherit privileges of roles it is a member of. This is the default."},{"signature":{"text":"-I --no-inherit","url":"/docs/18/app-createuser.html"},"summary":"The new role will not automatically inherit privileges of roles it is a member of."},{"signature":{"text":"--interactive","url":"/docs/18/app-createuser.html"},"summary":"Prompt for the user name if none is specified on the command line, and also prompt for whichever of the options -d / -D , -r / -R , -s / -S is not specified on the command line. (This was the default behavior up to PostgreSQL 9.1.)"},{"signature":{"text":"-l --login","url":"/docs/18/app-createuser.html"},"summary":"The new user will be allowed to log in (that is, the user name can be used as the initial session user identifier). This is the default."},{"signature":{"text":"-L --no-login","url":"/docs/18/app-createuser.html"},"summary":"The new user will not be allowed to log in. (A role without login privilege is still useful as a means of managing database permissions.)"},{"signature":{"text":"-m role --with-member= role","url":"/docs/18/app-createuser.html"},"summary":"Specifies an existing role that will be automatically added as a member of the new role. Multiple existing roles can be specified by writing multiple -m switches."},{"signature":{"text":"-P --pwprompt","url":"/docs/18/app-createuser.html"},"summary":"If given, createuser will issue a prompt for the password of the new user. This is not necessary if you do not plan on using password authentication."},{"signature":{"text":"-r --createrole","url":"/docs/18/app-createuser.html"},"summary":"The new user will be allowed to create, alter, drop, comment on, change the security label for other roles; that is, this user will have CREATEROLE privilege. See role creation for more details about what capabilities are conferred by this privilege."},{"signature":{"text":"-R --no-createrole","url":"/docs/18/app-createuser.html"},"summary":"The new user will not be allowed to create new roles. This is the default."},{"signature":{"text":"-s --superuser","url":"/docs/18/app-createuser.html"},"summary":"The new user will be a superuser."},{"signature":{"text":"-S --no-superuser","url":"/docs/18/app-createuser.html"},"summary":"The new user will not be a superuser. This is the default."},{"signature":{"text":"-v timestamp --valid-until= timestamp","url":"/docs/18/app-createuser.html"},"summary":"Set a date and time after which the role's password is no longer valid. The default is to set no password expiry date."},{"signature":{"text":"-V --version","url":"/docs/18/app-createuser.html"},"summary":"Print the createuser version and exit."},{"signature":{"text":"--bypassrls","url":"/docs/18/app-createuser.html"},"summary":"The new user will bypass every row-level security (RLS) policy."},{"signature":{"text":"--no-bypassrls","url":"/docs/18/app-createuser.html"},"summary":"The new user will not bypass row-level security (RLS) policies. This is the default."},{"signature":{"text":"--replication","url":"/docs/18/app-createuser.html"},"summary":"The new user will have the REPLICATION privilege, which is described more fully in the documentation for CREATE ROLE ."},{"signature":{"text":"--no-replication","url":"/docs/18/app-createuser.html"},"summary":"The new user will not have the REPLICATION privilege, which is described more fully in the documentation for CREATE ROLE . This is the default."},{"signature":{"text":"-? --help","url":"/docs/18/app-createuser.html"},"summary":"Show help about createuser command line arguments, and exit."},{"signature":{"text":"-h host --host= host","url":"/docs/18/app-createuser.html"},"summary":"Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket."},{"signature":{"text":"-p port --port= port","url":"/docs/18/app-createuser.html"},"summary":"Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections."},{"signature":{"text":"-U username --username= username","url":"/docs/18/app-createuser.html"},"summary":"User name to connect as (not the user name to create)."},{"signature":{"text":"-w --no-password","url":"/docs/18/app-createuser.html"},"summary":"Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password."},{"signature":{"text":"-W --password","url":"/docs/18/app-createuser.html"},"summary":"Force createuser to prompt for a password (for connecting to the server, not for the password of the new user)."}],"title":"Documented options"},{"columns":[{"key":"name","label":"Variable"},{"key":"description","label":"Meaning"}],"key":"environment","rows":[{"description":"Default connection parameters","name":"PGHOST PGPORT PGUSER"},{"description":"Specifies whether to use color in diagnostic messages. Possible values are always , auto and never .","name":"PG_COLOR"}],"title":"Environment variables"}]}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
