blob: 500c5f36893534da0a1a6d1bfeb4bae5b5c138c0 [file] [log] [blame]
---
title: ALTER USER
---
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
Changes the definition of a database role (user).
## <a id="alteruser__section2"></a>Synopsis
``` pre
ALTER USER <name> RENAME TO <newname>
ALTER USER <name> SET <config_parameter> {TO | =} {<value> | DEFAULT}
ALTER USER <name> RESET <config_parameter>
ALTER USER <name> [ [WITH] <option> [ ... ] ]
```
where \<option\> can be:
``` pre
SUPERUSER | NOSUPERUSER
| CREATEDB | NOCREATEDB
| CREATEROLE | NOCREATEROLE
| CREATEUSER | NOCREATEUSER
| INHERIT | NOINHERIT
| LOGIN | NOLOGIN
| [ ENCRYPTED | UNENCRYPTED ] PASSWORD '<password>'
| VALID UNTIL '<timestamp>'
```
## <a id="alteruser__section3"></a>Description
`ALTER USER` is a deprecated command but is still accepted for historical reasons. It is an alias for `ALTER ROLE`. See `ALTER ROLE` for more information.
## <a id="alteruser__section4"></a>Compatibility
The `ALTER USER` statement is a HAWQ extension. The SQL standard leaves the definition of users to the implementation.
## <a id="see"></a>See Also
[ALTER ROLE](ALTER-ROLE.html)