Skip to main content

ALTER USER

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

Syntax

Alter user name
ALTER USER user_name 
RENAME TO new_user_name
Alter user properties
CREATE USER user_name [ [ WITH ] system_permission [ ... ]['PASSWORD' { password | NULL }] ];

Parameters

Parameter or clauseDescription
user_nameThe name of the user to be modified.
new_user_nameThe new name of the user.
*system_permissionSee System permissions.

Example

The following statement rename the user user1 to user001.

ALTER USER user1 RENAME TO user001;

The following statement modifies the password and privileges of user001.

ALTER USER user001 NOSUPERUSER CREATEDB PASSWORD '4d2Df1ee5';

Help us make this doc better!