11<!--
2- $Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_user.sgml,v 1.18 2001/12/08 03:24:33 thomas Exp $
2+ $Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_user.sgml,v 1.19 2002/02/27 21:14:53 petere Exp $
33PostgreSQL documentation
44-->
55
66<refentry id="SQL-ALTERUSER">
77 <refmeta>
8- <refentrytitle id="sql-alteruser-title">
9- ALTER USER
10- </refentrytitle>
8+ <refentrytitle id="sql-alteruser-title">ALTER USER</refentrytitle>
119 <refmiscinfo>SQL - Language Statements</refmiscinfo>
1210 </refmeta>
11+
1312 <refnamediv>
14- <refname>
15- ALTER USER
16- </refname>
17- <refpurpose>
18- change a database user account
19- </refpurpose>
13+ <refname>ALTER USER</refname>
14+ <refpurpose>change a database user account</refpurpose>
2015 </refnamediv>
16+
2117 <refsynopsisdiv>
22- <refsynopsisdivinfo>
23- <date>2001-07-10</date>
24- </refsynopsisdivinfo>
25- <synopsis>
18+ <synopsis>
2619ALTER USER <replaceable class="PARAMETER">username</replaceable> [ [ WITH ] <replaceable class="PARAMETER">option</replaceable> [ ... ] ]
2720
2821where <replaceable class="PARAMETER">option</replaceable> can be:
2922
30- [ ENCRYPTED | UNENCRYPTED ] PASSWORD '<replaceable class="PARAMETER">password</replaceable>'
31- | CREATEDB | NOCREATEDB
32- | CREATEUSER | NOCREATEUSER
33- | VALID UNTIL '<replaceable class="PARAMETER">abstime</replaceable>'
34- </synopsis>
23+ [ ENCRYPTED | UNENCRYPTED ] PASSWORD '<replaceable class="PARAMETER">password</replaceable>'
24+ | CREATEDB | NOCREATEDB
25+ | CREATEUSER | NOCREATEUSER
26+ | VALID UNTIL '<replaceable class="PARAMETER">abstime</replaceable>'
27+ </synopsis>
28+ </refsynopsisdiv>
29+
30+ <refsect1>
31+ <title>Description</title>
3532
36- <refsect2 id="R2-SQL-ALTERUSER-1">
37- <refsect2info>
38- <date>1998-09-08</date>
39- </refsect2info>
40- <title>
41- Inputs
42- </title>
33+ <para>
34+ <command>ALTER USER</command> is used to change the attributes of a
35+ <productname>PostgreSQL</productname> user account. Attributes not
36+ mentioned in the command retain their previous settings.
37+ </para>
38+
39+ <para>
40+ Only a database superuser can change privileges and password
41+ expiration with this command. Ordinary users can only change their
42+ own password.
43+ </para>
44+
45+ <refsect2>
46+ <title>Parameters</title>
4347
4448 <para>
4549 <variablelist>
4650 <varlistentry>
4751 <term><replaceable class="PARAMETER">username</replaceable></term>
4852 <listitem>
4953 <para>
50- The name of the user whosedetails are to be altered.
54+ The name of the user whoseattributes are to be altered.
5155 </para>
5256 </listitem>
5357 </varlistentry>
@@ -62,39 +66,40 @@ where <replaceable class="PARAMETER">option</replaceable> can be:
6266 </varlistentry>
6367
6468 <varlistentry>
65- <term>ENCRYPTED</term>
66- <term>UNENCRYPTED</term>
69+ <term><literal> ENCRYPTED</literal> </term>
70+ <term><literal> UNENCRYPTED</literal> </term>
6771 <listitem>
68- <para>
69- Thesekeywords control whether the
70- password is stored encrypted in <literal>pg_shadow</>. (See
72+ <para>
73+ Thesekey words control whether the password is stored
74+ encrypted in <literal>pg_shadow</>. (See
7175<xref linkend="SQL-CREATEUSER" endterm="SQL-CREATEUSER-title">
7276for more information about this choice.)
7377 </para>
7478 </listitem>
7579 </varlistentry>
7680
7781 <varlistentry>
78- <term>CREATEDB</term>
79- <term>NOCREATEDB</term>
82+ <term><literal> CREATEDB</literal> </term>
83+ <term><literal> NOCREATEDB</literal> </term>
8084 <listitem>
81- <para>
82- These clauses define a user's ability to create databases.
83- If CREATEDB is specified, the user being defined will
84- be allowed to create his own databases. Using NOCREATEDB
85- will deny a user the ability to create databases.
85+ <para>
86+ These clauses define a user's ability to create databases. If
87+ <literal>CREATEDB</literal> is specified, the user being
88+ defined will be allowed to create his own databases. Using
89+ <literal>NOCREATEDB</literal> will deny a user the ability to
90+ create databases.
8691 </para>
8792 </listitem>
8893 </varlistentry>
8994
9095 <varlistentry>
91- <term>CREATEUSER</term>
92- <term>NOCREATEUSER</term>
96+ <term><literal> CREATEUSER</literal> </term>
97+ <term><literal> NOCREATEUSER</literal> </term>
9398 <listitem>
9499 <para>
95100These clauses determine whether a user will be permitted to
96101create new users himself. This option will also make the user
97- a superuser who can override all access restrictions.
102+ a superuser who can override all access restrictions.
98103 </para>
99104 </listitem>
100105 </varlistentry>
@@ -111,122 +116,105 @@ where <replaceable class="PARAMETER">option</replaceable> can be:
111116 </variablelist>
112117 </para>
113118 </refsect2>
114-
115- <refsect2 id="R2-SQL-ALTERUSER-2">
116- <refsect2info>
117- <date>1998-09-08</date>
118- </refsect2info>
119- <title>
120- Outputs
121- </title>
122- <para>
123- <variablelist>
124- <varlistentry>
125- <term><computeroutput>ALTER USER</computeroutput></term>
126- <listitem>
127- <para>
128- Message returned if the alteration was successful.
129- </para>
130- </listitem>
131- </varlistentry>
132-
133- <varlistentry>
134- <term><computeroutput>
135- ERROR: ALTER USER: user "username" does not exist
136- </computeroutput></term>
137- <listitem>
138- <para>
139- Error message returned if the specified user is not known to
140- the database.
141- </para>
142- </listitem>
143- </varlistentry>
144- </variablelist>
145- </para>
146- </refsect2>
147- </refsynopsisdiv>
119+ </refsect1>
120+
121+ <refsect1>
122+ <title>Diagnostics</title>
148123
149- <refsect1 id="R1-SQL-ALTERUSER-1">
150- <refsect1info>
151- <date>1998-09-08</date>
152- </refsect1info>
153- <title>
154- Description
155- </title>
156124 <para>
157- <command>ALTER USER</command> is used to change the attributes of a user's
158- <productname>PostgreSQL</productname> account. Attributes not mentioned
159- in the command retain their previous settings.
125+ <variablelist>
126+ <varlistentry>
127+ <term><computeroutput>ALTER USER</computeroutput></term>
128+ <listitem>
129+ <para>
130+ Message returned if the alteration was successful.
131+ </para>
132+ </listitem>
133+ </varlistentry>
134+
135+ <varlistentry>
136+ <term><computeroutput>ERROR: ALTER USER: user "username" does not exist</computeroutput></term>
137+ <listitem>
138+ <para>
139+ Error message returned if the specified user is not known to
140+ the database.
141+ </para>
142+ </listitem>
143+ </varlistentry>
144+ </variablelist>
160145 </para>
146+ </refsect1>
147+
148+ <refsect1>
149+ <title>Notes</title>
150+
161151 <para>
162- Only a database superuser
163- can change privileges andpassword expiration with this command. Ordinary
164- users can only change their own password .
152+ Use <xref linkend="SQL-CREATEUSER" endterm="SQL-CREATEUSER-title">
153+ to add new users, and<xref linkend="SQL-DROPUSER"
154+ endterm="SQL-DROPUSER-title"> to remoe a user .
165155 </para>
156+
166157 <para>
167158 <command>ALTER USER</command> cannot change a user's group memberships.
168159 Use <xref linkend="SQL-ALTERGROUP" endterm="SQL-ALTERGROUP-title">
169160 to do that.
170161 </para>
171- <para>
172- Use <xref linkend="SQL-CREATEUSER" endterm="SQL-CREATEUSER-title">
173- to create a new user and <xref linkend="SQL-DROPUSER"
174- endterm="SQL-DROPUSER-title"> to remove a user.
175- </para>
176162 </refsect1>
177163
178- <refsect1 id="R1-SQL-ALTERUSER-2">
179- <title>
180- Usage
181- </title>
164+ <refsect1>
165+ <title>Examples</title>
166+
182167 <para>
183168 Change a user password:
184169
185170<programlisting>
186171ALTER USER davide WITH PASSWORD 'hu8jmn3';
187172</programlisting>
173+ </para>
188174
175+ <para>
189176 Change a user's valid until date:
190177
191178<programlisting>
192179ALTER USER manuel VALID UNTIL 'Jan 31 2030';
193180</programlisting>
181+ </para>
194182
183+ <para>
195184 Change a user's valid until date, specifying that his
196185 authorization should expire at midday on 4th May 1998 using
197186 the time zone which is one hour ahead of UTC:
198187<programlisting>
199188ALTER USER chris VALID UNTIL 'May 4 12:00:00 1998 +1';
200189</programlisting>
190+ </para>
201191
192+ <para>
202193 Give a user the ability to create other users and new databases:
203194
204195<programlisting>
205196ALTER USER miriam CREATEUSER CREATEDB;
206197</programlisting>
207-
208198 </para>
209199 </refsect1>
210200
211- <refsect1 id="R1-SQL-ALTERUSER-3">
212- <title>
213- Compatibility
214- </title>
201+ <refsect1>
202+ <title>Compatibility</title>
215203
216- <refsect2 id="R2-SQL-ALTERUSER-4" >
217- <refsect2info>
218- <date>1998-09-08</date>
219- </refsect2info>
220- <title >
221- SQL92
222- </title>
223- <para >
224- There is no <command>ALTER USER</command> statement in
225- <acronym>SQL92</acronym>.
226- The standard leaves
227- the definition of users to the implementation.
228- </para >
229- </refsect2 >
204+ <para >
205+ The <command>ALTER USER</command> statement is a
206+ <productname>PostgreSQL</productname> extension. The SQL standard
207+ leaves the definition of users to the implementation.
208+ </para >
209+ </refsect1>
210+
211+ <refsect1 >
212+ <title>See Also</title>
213+
214+ <simplelist type="inline">
215+ <member><xref linkend="sql-createuser" endterm="sql-createuser-title"></member>
216+ <member><xref linkend="sql-dropuser" endterm="sql-dropuser-title"></member >
217+ </simplelist >
230218 </refsect1>
231219</refentry>
232220