2 $Header: /cvsroot/pgsql/doc/src/sgml/ref/createuser.sgml,v 1.7 1999/12/07 22:41:41 momjian Exp $
6 <refentry id="APP-CREATEUSER">
8 <refentrytitle id="APP-CREATEUSER-TITLE">
9 <application>createuser</application>
11 <refmiscinfo>Application</refmiscinfo>
15 <application>createuser</application>
18 Create a new <productname>PostgreSQL</productname> user
23 <date>1999-11-07</date>
27 createuser [ <replaceable class="parameter">options</replaceable> ] [ <replaceable class="parameter">username</replaceable> ]
30 <refsect2 id="R2-APP-CREATEUSER-1">
32 <date>1999-11-07</date>
41 <term>-h, --host <replaceable class="parameter">host</replaceable></term>
44 Specifies the hostname of the machine on which the
45 <application>postmaster</application>
52 <term>-p, --port <replaceable class="parameter">port</replaceable></term>
55 Specifies the Internet TCP/IP port or local Unix domain socket file
56 extension on which the <application>postmaster</application>
57 is listening for connections.
63 <term>-e, --echo</term>
66 Echo the queries that <application>createdb</application> generates
67 and sends to the backend.
73 <term>-q, --quiet</term>
76 Do not display a response.
82 <term>-d, --createdb</term>
85 Allows the new user to create databases.
91 <term>-D, --no-createdb</term>
94 Forbids the new user to create databases.
100 <term>-a, --adduser</term>
103 Allows the new user to create other users.
109 <term>-A, --no-adduser</term>
112 Forbids the new user to create other users.
118 <term>-P, --pwprompt</term>
121 If given, <application>createuser</application> will issue a prompt for
122 the password of the new user. This is not necessary if you do not plan
123 on using password authentication.
129 <term>-i, --sysid <replaceable class="parameter">uid</replaceable></term>
132 Allows you to pick a non-default user id for the new user. This is not
133 necessary, but some people like it.
139 <term><replaceable class="parameter">username</replaceable></term>
142 Specifies the name of the <productname>PostgreSQL</productname> user to be created.
143 This name must be unique among all <productname>PostgreSQL</productname> users.
149 You will be prompted for a name and other missing information if it is not
150 specified on the command line.
154 The options <literal>-h</literal>, <literal>-p</literal>, and <literal>-e</literal>,
155 are passed on literally to <xref linkend="APP-PSQL" endterm="APP-PSQL-title">. The
156 <application>psql</application> options <literal>-U</literal> and <literal>-W</literal>
157 are available as well, but their use can be confusing in this context.
161 <refsect2 id="R2-APP-CREATEUSER-2">
163 <date>1999-11-07</date>
171 <term><computeroutput>CREATE USER</computeroutput></term>
180 <term><computeroutput>createuser: Creation of user "<replaceable class="parameter">username</replaceable>" failed.</computeroutput></term>
183 Something went wrong. The user was not created.
190 If there is an error condition, the backend error message will be displayed.
191 See <xref linkend="SQL-CREATEUSER" endterm="SQL-CREATEUSER-title">
192 and <xref linkend="APP-PSQL" endterm="APP-PSQL-title"> for possibilities.
197 <refsect1 id="R1-APP-CREATEUSER-1">
199 <date>1998-11-07</date>
205 <application>createuser</application> creates a
206 new <productname>PostgreSQL</productname> user.
207 Only users with <literal>usesuper</literal> set in
208 the <literal>pg_shadow</literal> class can create
209 new <productname>Postgres</productname> users.
213 <application>createuser</application> is a shell script wrapper around the
214 <acronym>SQL</acronym> command
215 <xref linkend="SQL-CREATEUSER" endterm="SQL-CREATEUSER-title"> via
216 the <productname>PostgreSQL</productname> interactive terminal
217 <xref linkend="APP-PSQL" endterm="APP-PSQL-title">. Thus, there is nothing
218 special about creating users via this or other methods. This means
219 that the <application>psql</application> must be found by the script and that
220 a database server is running at the targeted host. Also, any default
221 settings and environment variables available to <application>psql</application>
222 and the <application>libpq</application> front-end library do apply.
228 <refsect1 id="R1-APP-CREATEUSER-2">
230 <date>1999-11-07</date>
236 To create a user <literal>joe</literal>
237 on the default database server:
240 $ <userinput>createuser joe</userinput>
241 Is the new user allowed to create databases? (y/n) <userinput>n</userinput>
242 Shall the new user be allowed to create more new users? (y/n) <userinput>n</userinput>
248 To create the same user <literal>joe</literal>
249 using the postmaster on host eden, port 5000, avoiding
250 the prompts and taking a look at the underlying query:
253 $ <userinput>createuser -p 5000 -h eden -D -A -e joe</userinput>
254 CREATE USER "joe" NOCREATEDB NOCREATEUSER
262 <!-- Keep this comment at the end of the file
267 sgml-minimize-attributes:nil
268 sgml-always-quote-attributes:t
271 sgml-parent-document:nil
272 sgml-default-dtd-file:"../reference.ced"
273 sgml-exposed-tags:nil
274 sgml-local-catalogs:"/usr/lib/sgml/catalog"
275 sgml-local-ecat-files:nil