Скачать в pdf «PostgreSQL»

username Specifies the name of the Postgres user to be created. This name must be unique among all Postgres users.

You will be prompted for a name and other missing information if it is not specified on the command line. The options -h, -p, and -e, are passed on literally to psql. The psql options -U and -W are available as well, but their use can be confusing in this context.


create user All is well,

ereateuser: creation of user «username » failed Something went wrong. The user was not created.

If there is an error condition, the backend error message will be displayed. See CREATE USER andpsql for possibilities.


createuser creates a new Postgres user. Only users with usesuper set in the pg_shadow class can create new Postgres users.

createuser is a shell script wrapper around the SQL command CREATE USER via the Postgres interactive terminal psql. Thus, there is nothing special about creating users via this or other methods. This means that the psql must be found by the script and that a database server is running at the targeted host. Also, any default settings and environment variables available to psql and the libpq front-end library do apply.


To create a user joe on the default database server:

$ createuser joe

Is the new user allowed to create databases? (y/n) n

Shall the new user be allowed to create more new users? (y/n) n

create user

Скачать в pdf «PostgreSQL»