]> granicus.if.org Git - postgresql/blob - doc/src/sgml/ref/alter_user.sgml
Very minor formatting fixup in the refentry id field to remove
[postgresql] / doc / src / sgml / ref / alter_user.sgml
1   <REFENTRY ID="SQL-ALTERUSER">
2    <REFMETA>
3     <REFENTRYTITLE>
4      ALTER USER
5     </REFENTRYTITLE>
6     <REFMISCINFO>SQL - Language Statements</REFMISCINFO>
7    </REFMETA>
8    <REFNAMEDIV>
9     <REFNAME>
10      ALTER USER
11     </REFNAME>
12     <REFPURPOSE>
13      Modifies user account information
14     </REFPURPOSE>
15    <REFSYNOPSISDIV>
16     <REFSYNOPSISDIVINFO>
17      <DATE>1998-04-15</DATE>
18     </REFSYNOPSISDIVINFO>
19     <synopsis>
20      ALTER USER <replaceable class="PARAMETER">username</replaceable>
21      [WITH PASSWORD <replaceable class="PARAMETER">password</replaceable>]
22      [CREATEDB | NOCREATEDB]
23      [CREATEUSER | NOCREATEUSER]
24      [IN GROUP <replaceable class="PARAMETER">groupname</replaceable> [, ...] ]
25      [VALID UNTIL '<replaceable class="PARAMETER">abstime</replaceable>']
26     </synopsis>
27     
28     <REFSECT2 ID="R2-SQL-ALTERUSER-1">
29      <REFSECT2INFO>
30       <DATE>1998-04-15</DATE>
31      </REFSECT2INFO>
32      <TITLE>
33       Inputs
34      </TITLE>
35      <PARA>
36       Refer to CREATE USER statement for a detailed description of each
37       clause.
38      </para>
39       <VARIABLELIST>
40        <VARLISTENTRY>
41         <TERM>
42          <REPLACEABLE CLASS="PARAMETER"> username </REPLACEABLE>
43         </TERM>
44         <LISTITEM>
45          <PARA>
46           The Postgres account name of the user whose details are to be altered.
47          </PARA>
48         </LISTITEM>
49        </VARLISTENTRY>
50        <VARLISTENTRY>
51         <TERM>
52          <REPLACEABLE CLASS="PARAMETER"> password </REPLACEABLE>
53         </TERM>
54         <LISTITEM>
55          <PARA>
56           The new password to be used for this account.
57          </PARA>
58         </LISTITEM>
59        </VARLISTENTRY>
60        <VARLISTENTRY>
61         <TERM>
62          <REPLACEABLE CLASS="PARAMETER"> groupname </REPLACEABLE>
63         </TERM>
64         <LISTITEM>
65          <PARA>
66           The name of an access group into which this account is to be put.
67          </PARA>
68         </LISTITEM>
69        </VARLISTENTRY>
70        <VARLISTENTRY>
71         <TERM>
72          <REPLACEABLE CLASS="PARAMETER"> abstime </REPLACEABLE>
73         </TERM>
74         <LISTITEM>
75          <PARA>
76           The date (and, optionally, the time) at which this user's access is to be terminated.
77          </PARA>
78         </LISTITEM>
79        </VARLISTENTRY>
80       </VARIABLELIST>
81     </REFSECT2>
82     
83     <REFSECT2 ID="R2-SQL-ALTERUSER-2">
84      <REFSECT2INFO>
85       <DATE>1998-04-15</DATE>
86      </REFSECT2INFO>
87      <TITLE>
88       Outputs
89      </TITLE>
90      <PARA>
91      </PARA>
92      <VARIABLELIST>
93       <VARLISTENTRY>
94        <TERM>
95         <ReturnValue>status</ReturnValue>
96        </TERM>
97        <LISTITEM>
98         <PARA>
99          <VARIABLELIST>
100           <VARLISTENTRY>
101            <TERM>
102             <ReturnValue>ALTER USER</ReturnValue>
103            </TERM>
104            <LISTITEM>
105             <PARA>
106              Message returned if the alteration was successful.
107             </PARA>
108            </LISTITEM>
109           </VARLISTENTRY>
110           
111           <VARLISTENTRY>
112            <TERM>
113             <ReturnValue>ERROR: alterUser: user "username" does not exist</ReturnValue>
114            </TERM>
115            <LISTITEM>
116             <PARA>
117              Error message returned if the user specified doesn't
118              exist.
119             </PARA>
120            </LISTITEM>
121           </VARLISTENTRY>
122          </VARIABLELIST>
123         </para>
124        </listitem>
125       </varlistentry>
126      </variablelist>
127     </REFSECT2>
128    </REFSYNOPSISDIV>
129    
130    <REFSECT1 ID="R1-SQL-ALTERUSER-1">
131     <REFSECT1INFO>
132      <DATE>1998-04-15</DATE>
133     </REFSECT1INFO>
134     <TITLE>
135      Description
136     </TITLE>
137     <PARA>
138      ALTER USER is used to change the attributes of a user's
139      PostgreSQL account. Please note that it is not possible
140      to alter a user's "usesysid" via the alter user
141      statement. Also, it is only possible for the PostgreSQL
142      user or any user with read and modify permissions on
143      "pg_shadow" to alter user passwords.
144     </PARA>
145     <para>
146      If any of the clauses of the alter user statement are
147      omitted, the corresponding value in the "pg_shadow" table
148      is left unchanged.
149     </para>
150     
151     <REFSECT2 ID="R2-SQL-ALTERUSER-3">
152      <REFSECT2INFO>
153       <DATE>1998-04-15</DATE>
154      </REFSECT2INFO>
155      <TITLE>
156       Notes
157      </TITLE>
158      <PARA>
159       ALTER USER statement is a PostgreSQL language extension.
160      </para>
161      <para>
162       Refer to CREATE/DROP USER statements to create/remove an user
163       account.
164      </para>
165      <para>
166       At the current release (6.3.2), the IN GROUP clause is parsed
167       but has no effect.  When it is fully implemented, it is
168       intended to modify the pg_group relation.
169      </para>
170     </REFSECT2>
171    </refsect1>
172    
173    <REFSECT1 ID="R1-SQL-ALTERUSER-2">
174     <TITLE>
175      Usage
176     </TITLE>
177     <PARA>
178      Change a user password
179     </PARA>
180     <ProgramListing>
181      ALTER USER davide WITH PASSWORD hu8jmn3;
182     </ProgramListing>
183     <para>
184      Change a user's valid until date
185     </para>
186     <ProgramListing>
187      ALTER USER manuel VALID UNTIL 'Jan 31 2030';
188     </ProgramListing>
189     <para>
190      Change a user's valid until date, specifying that his
191 authorisation should expire at midday on 4th May 1998 using
192 the time zone which is one hour ahead of UTC
193     </para>
194     <ProgramListing>
195      ALTER USER chris VALID UNTIL 'May 4 12:00:00 1998 +1';
196     </ProgramListing>
197     <para>
198      Give a user the ability to create other users and new databases.
199     </para>
200     <programlisting>
201      ALTER USER miriam CREATEUSER CREATEDB;
202     </programlisting>
203     <para>
204      Place a user in two groups
205     </para>
206     <programlisting>
207      ALTER USER miriam IN GROUP sales, payroll;
208     </programlisting>
209    </REFSECT1>
210    
211    <REFSECT1 ID="R1-SQL-ALTERUSER-3">
212     <TITLE>
213      Compatibility
214     </TITLE>
215     <PARA>
216     </PARA>
217     
218     <REFSECT2 ID="R2-SQL-ALTERUSER-4">
219      <REFSECT2INFO>
220       <DATE>1998-04-15</DATE>
221      </REFSECT2INFO>
222      <TITLE>
223       SQL92
224      </TITLE>
225      <PARA>
226       There is no ALTER USER statement in SQL92.  The standard leaves
227       the definition of users to the implementation.
228      </PARA>
229    </refsect1>
230   </REFENTRY>
231
232 <!-- Keep this comment at the end of the file
233 Local variables:
234 mode: sgml
235 sgml-omittag:t
236 sgml-shorttag:t
237 sgml-minimize-attributes:nil
238 sgml-always-quote-attributes:t
239 sgml-indent-step:1
240 sgml-indent-data:t
241 sgml-parent-document:nil
242 sgml-default-dtd-file:"../reference.ced"
243 sgml-exposed-tags:nil
244 sgml-local-catalogs:"/usr/lib/sgml/catalog"
245 sgml-local-ecat-files:nil
246 End:
247 -->