Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf81a77d

Browse files
committed
Update createuser examples to match the current program behavior,
and add an example showing assignment of a password. Per suggestionfrom Jari Aalto (via Martin Pitt).
1 parent3a3804d commitf81a77d

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

‎doc/src/sgml/ref/createuser.sgml

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/createuser.sgml,v 1.39 2003/11/29 19:51:38 pgsql Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/createuser.sgml,v 1.40 2005/05/13 16:31:43 tgl Exp $
33
PostgreSQL documentation
44
-->
55

@@ -68,8 +68,10 @@ PostgreSQL documentation
6868
<term><replaceable class="parameter">username</replaceable></term>
6969
<listitem>
7070
<para>
71-
Specifies the name of the <productname>PostgreSQL</productname> user to be created.
72-
This name must be unique among all <productname>PostgreSQL</productname> users.
71+
Specifies the name of the <productname>PostgreSQL</productname> user
72+
to be created.
73+
This name must be unique among all users of this
74+
<productname>PostgreSQL</productname> installation.
7375
</para>
7476
</listitem>
7577
</varlistentry>
@@ -290,7 +292,7 @@ PostgreSQL documentation
290292
server:
291293
<screen>
292294
<prompt>$ </prompt><userinput>createuser joe</userinput>
293-
<computeroutput>Is the new user allowed to create databases? (y/n) </computeroutput><userinput>n</userinput>
295+
<computeroutput>Shall the new user be allowed to create databases? (y/n) </computeroutput><userinput>n</userinput>
294296
<computeroutput>Shall the new user be allowed to create more new users? (y/n) </computeroutput><userinput>n</userinput>
295297
<computeroutput>CREATE USER</computeroutput>
296298
</screen>
@@ -301,11 +303,28 @@ PostgreSQL documentation
301303
server on host <literal>eden</>, port 5000, avoiding the prompts and
302304
taking a look at the underlying command:
303305
<screen>
304-
<prompt>$ </prompt><userinput>createuser -p 5000 -h eden -D -A -e joe</userinput>
305-
<computeroutput>CREATE USER"joe" NOCREATEDB NOCREATEUSER</computeroutput>
306+
<prompt>$ </prompt><userinput>createuser -h eden -p 5000 -D -A -e joe</userinput>
307+
<computeroutput>CREATE USER joe NOCREATEDB NOCREATEUSER;</computeroutput>
306308
<computeroutput>CREATE USER</computeroutput>
307309
</screen>
308310
</para>
311+
312+
<para>
313+
To create the user <literal>joe</literal> as a superuser,
314+
and assign a password immediately:
315+
<screen>
316+
<prompt>$ </prompt><userinput>createuser -P -d -a -e joe</userinput>
317+
<computeroutput>Enter password for new user: </computeroutput><userinput>xyzzy</userinput>
318+
<computeroutput>Enter it again: </computeroutput><userinput>xyzzy</userinput>
319+
<computeroutput>CREATE USER joe PASSWORD 'xyzzy' CREATEDB CREATEUSER;</computeroutput>
320+
<computeroutput>CREATE USER</computeroutput>
321+
</screen>
322+
In the above example, the new password isn't actually echoed when typed,
323+
but we show what was typed for clarity. However the password
324+
<emphasis>will</> appear in the echoed command, as illustrated &mdash;
325+
so you don't want to use <literal>-e</> when assigning a password, if
326+
anyone else can see your screen.
327+
</para>
309328
</refsect1>
310329

311330

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp