1
1
<!--
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 $
3
3
PostgreSQL documentation
4
4
-->
5
5
6
6
<refentry id="SQL-ALTERUSER">
7
7
<refmeta>
8
- <refentrytitle id="sql-alteruser-title">
9
- ALTER USER
10
- </refentrytitle>
8
+ <refentrytitle id="sql-alteruser-title">ALTER USER</refentrytitle>
11
9
<refmiscinfo>SQL - Language Statements</refmiscinfo>
12
10
</refmeta>
11
+
13
12
<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>
20
15
</refnamediv>
16
+
21
17
<refsynopsisdiv>
22
- <refsynopsisdivinfo>
23
- <date>2001-07-10</date>
24
- </refsynopsisdivinfo>
25
- <synopsis>
18
+ <synopsis>
26
19
ALTER USER <replaceable class="PARAMETER">username</replaceable> [ [ WITH ] <replaceable class="PARAMETER">option</replaceable> [ ... ] ]
27
20
28
21
where <replaceable class="PARAMETER">option</replaceable> can be:
29
22
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>
35
32
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>
43
47
44
48
<para>
45
49
<variablelist>
46
50
<varlistentry>
47
51
<term><replaceable class="PARAMETER">username</replaceable></term>
48
52
<listitem>
49
53
<para>
50
- The name of the user whose details are to be altered.
54
+ The name of the user whose attributes are to be altered.
51
55
</para>
52
56
</listitem>
53
57
</varlistentry>
@@ -62,39 +66,40 @@ where <replaceable class="PARAMETER">option</replaceable> can be:
62
66
</varlistentry>
63
67
64
68
<varlistentry>
65
- <term>ENCRYPTED</term>
66
- <term>UNENCRYPTED</term>
69
+ <term><literal> ENCRYPTED</literal> </term>
70
+ <term><literal> UNENCRYPTED</literal> </term>
67
71
<listitem>
68
- <para>
69
- These keywords control whether the
70
- password is stored encrypted in <literal>pg_shadow</>. (See
72
+ <para>
73
+ These key words control whether the password is stored
74
+ encrypted in <literal>pg_shadow</>. (See
71
75
<xref linkend="SQL-CREATEUSER" endterm="SQL-CREATEUSER-title">
72
76
for more information about this choice.)
73
77
</para>
74
78
</listitem>
75
79
</varlistentry>
76
80
77
81
<varlistentry>
78
- <term>CREATEDB</term>
79
- <term>NOCREATEDB</term>
82
+ <term><literal> CREATEDB</literal> </term>
83
+ <term><literal> NOCREATEDB</literal> </term>
80
84
<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.
86
91
</para>
87
92
</listitem>
88
93
</varlistentry>
89
94
90
95
<varlistentry>
91
- <term>CREATEUSER</term>
92
- <term>NOCREATEUSER</term>
96
+ <term><literal> CREATEUSER</literal> </term>
97
+ <term><literal> NOCREATEUSER</literal> </term>
93
98
<listitem>
94
99
<para>
95
100
These clauses determine whether a user will be permitted to
96
101
create 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.
98
103
</para>
99
104
</listitem>
100
105
</varlistentry>
@@ -111,122 +116,105 @@ where <replaceable class="PARAMETER">option</replaceable> can be:
111
116
</variablelist>
112
117
</para>
113
118
</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>
148
123
149
- <refsect1 id="R1-SQL-ALTERUSER-1">
150
- <refsect1info>
151
- <date>1998-09-08</date>
152
- </refsect1info>
153
- <title>
154
- Description
155
- </title>
156
124
<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>
160
145
</para>
146
+ </refsect1>
147
+
148
+ <refsect1>
149
+ <title>Notes</title>
150
+
161
151
<para>
162
- Only a database superuser
163
- can change privileges and password 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 .
165
155
</para>
156
+
166
157
<para>
167
158
<command>ALTER USER</command> cannot change a user's group memberships.
168
159
Use <xref linkend="SQL-ALTERGROUP" endterm="SQL-ALTERGROUP-title">
169
160
to do that.
170
161
</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>
176
162
</refsect1>
177
163
178
- <refsect1 id="R1-SQL-ALTERUSER-2">
179
- <title>
180
- Usage
181
- </title>
164
+ <refsect1>
165
+ <title>Examples</title>
166
+
182
167
<para>
183
168
Change a user password:
184
169
185
170
<programlisting>
186
171
ALTER USER davide WITH PASSWORD 'hu8jmn3';
187
172
</programlisting>
173
+ </para>
188
174
175
+ <para>
189
176
Change a user's valid until date:
190
177
191
178
<programlisting>
192
179
ALTER USER manuel VALID UNTIL 'Jan 31 2030';
193
180
</programlisting>
181
+ </para>
194
182
183
+ <para>
195
184
Change a user's valid until date, specifying that his
196
185
authorization should expire at midday on 4th May 1998 using
197
186
the time zone which is one hour ahead of UTC:
198
187
<programlisting>
199
188
ALTER USER chris VALID UNTIL 'May 4 12:00:00 1998 +1';
200
189
</programlisting>
190
+ </para>
201
191
192
+ <para>
202
193
Give a user the ability to create other users and new databases:
203
194
204
195
<programlisting>
205
196
ALTER USER miriam CREATEUSER CREATEDB;
206
197
</programlisting>
207
-
208
198
</para>
209
199
</refsect1>
210
200
211
- <refsect1 id="R1-SQL-ALTERUSER-3">
212
- <title>
213
- Compatibility
214
- </title>
201
+ <refsect1>
202
+ <title>Compatibility</title>
215
203
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 >
230
218
</refsect1>
231
219
</refentry>
232
220
0 commit comments