Skip to main content

ALTER USER

Use the ALTER USER command to modify the name, password, privileges, and other properties of an existing user.

Syntax

Alter user name.
ALTER USER user_name
RENAME TO new_user_name
Alter user properties.
ALTER USER user_name
[ [ WITH ] option [ ... ] ]

Parameters

Parameter or clauseDescription
user_nameThe name of the user to be modified.
new_user_nameThe new name of the user.
WITH optionSee WITH options in CREATE USER.

Example

The following statement rename the user user1 to user001.

ALTER USER user1 RENAME TO user001;

The following statement modify the password and privileges of user001.

ALTER USER user001 NOSUPERUSER CREATEDB PASSWORD '4d2Df1ee5';

Help us make this doc better!