Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
createuser(1)
Edit
PageHistory
Diff
Info
LikePages
CREATEUSER !!!CREATEUSER NAME SYNOPSIS DESCRIPTION USAGE ---- !!NAME createuser - define a new PostgreSQL user account !!SYNOPSIS __createuser__ [[ ''options''... ] [[ ''username'' ] __INPUTS__ __-h, --host__ ''host'' Specifies the host name of the machine on which the server is running. If host begins with a slash, it is used as the directory for the Unix domain socket. __-p, --port__ ''port'' Specifies the Internet TCP/IP port or local Unix domain socket file extension on which the server is listening for connections. __-e, --echo__ Echo the queries that __createuser__ generates and sends to the server. __-q, --quiet__ Do not display a response. __-d, --createdb__ The new user is allowed to create databases. __-D, --no-createdb__ The new user is not allowed to create databases. __-a, --adduser__ The new user is allowed to create other users. (Note: actually, this makes the new user a ''superuser''. The option is poorly named.) __-A, --no-adduser__ The new user is not allowed to create other users (i.e., the new user is a regular user not a superuser). __-P, --pwprompt__ 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. __-i, --sysid__ ''uid'' Allows you to pick a non-default user id for the new user. This is not necessary, but some people like it. __-E, --encrypted__ Encrypts the user's password stored in the database. If not specified, the default is used. __-N, --unencrypted__ Does not encrypt the user's password stored in the database. If not specified, the default is used. ''username'' Specifies the name of the PostgreSQL user to be created. This name must be unique among all PostgreSQL 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(1). The __psql__ options -U and -W are available as well, but their use can be confusing in this context. __OUTPUTS__ __CREATE USER__ All is well. __createuser: creation of user __''username''____ Something went wrong. The user was not created. If there is an error condition, the backend error message will be displayed. See CREATE USER [[__create_user__(l)] and psql(1) for possibilities. !!DESCRIPTION __createuser__ creates a new PostgreSQL user. Only superusers (users with usesuper set in the pg_shadow table) can create new PostgreSQL users, so __createuser__ must be invoked by someone who is a PostgreSQL superuser. Being a superuser also implies the ability to bypass access permission checks within the database, so superuser-dom should not be granted lightly. __createuser__ is a shell script wrapper around the SQL command CREATE USER [[__create_user__(l)] via the PostgreSQL interactive terminal psql(1). Thus, there is nothing special about creating users via this or other methods. This means that the __psql__ application must be found by the script and that a database server must be running at the targeted host. Also, any default settings and environment variables used by __psql__ and the __libpq__ front-end library will apply. !!USAGE 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 To create the same user joe using the server on host eden, port 5000, avoiding the prompts and taking a look at the underlying query: $ __createuser -p 5000 -h eden -D -A -e joe __CREATE USER __ ----
2 pages link to
createuser(1)
:
pg_wrapper(1)
Man1c
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.