1 <REFENTRY ID="SQL-ALTERUSER">
6 <REFMISCINFO>SQL - Language Statements</REFMISCINFO>
13 Modifies user account information
17 <DATE>1998-04-15</DATE>
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>']
28 <REFSECT2 ID="R2-SQL-ALTERUSER-1">
30 <DATE>1998-04-15</DATE>
36 Refer to CREATE USER statement for a detailed description of each
42 <REPLACEABLE CLASS="PARAMETER"> username </REPLACEABLE>
46 The Postgres account name of the user whose details are to be altered.
52 <REPLACEABLE CLASS="PARAMETER"> password </REPLACEABLE>
56 The new password to be used for this account.
62 <REPLACEABLE CLASS="PARAMETER"> groupname </REPLACEABLE>
66 The name of an access group into which this account is to be put.
72 <REPLACEABLE CLASS="PARAMETER"> abstime </REPLACEABLE>
76 The date (and, optionally, the time) at which this user's access is to be terminated.
83 <REFSECT2 ID="R2-SQL-ALTERUSER-2">
85 <DATE>1998-04-15</DATE>
95 <ReturnValue>status</ReturnValue>
102 <ReturnValue>ALTER USER</ReturnValue>
106 Message returned if the alteration was successful.
113 <ReturnValue>ERROR: alterUser: user "username" does not exist</ReturnValue>
117 Error message returned if the user specified doesn't
130 <REFSECT1 ID="R1-SQL-ALTERUSER-1">
132 <DATE>1998-04-15</DATE>
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.
146 If any of the clauses of the alter user statement are
147 omitted, the corresponding value in the "pg_shadow" table
151 <REFSECT2 ID="R2-SQL-ALTERUSER-3">
153 <DATE>1998-04-15</DATE>
159 ALTER USER statement is a PostgreSQL language extension.
162 Refer to CREATE/DROP USER statements to create/remove an user
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.
173 <REFSECT1 ID="R1-SQL-ALTERUSER-2">
178 Change a user password
181 ALTER USER davide WITH PASSWORD hu8jmn3;
184 Change a user's valid until date
187 ALTER USER manuel VALID UNTIL 'Jan 31 2030';
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
195 ALTER USER chris VALID UNTIL 'May 4 12:00:00 1998 +1';
198 Give a user the ability to create other users and new databases.
201 ALTER USER miriam CREATEUSER CREATEDB;
204 Place a user in two groups
207 ALTER USER miriam IN GROUP sales, payroll;
211 <REFSECT1 ID="R1-SQL-ALTERUSER-3">
218 <REFSECT2 ID="R2-SQL-ALTERUSER-4">
220 <DATE>1998-04-15</DATE>
226 There is no ALTER USER statement in SQL92. The standard leaves
227 the definition of users to the implementation.
232 <!-- Keep this comment at the end of the file
237 sgml-minimize-attributes:nil
238 sgml-always-quote-attributes: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