ALTER USER

Function

Modifies the attributes of a database user.

Important Notes

Session parameters modified by ALTER USER apply to a specified user and take effect in the next session.

Syntax

Parameters

Example

Change the login password of user jim.

1
ALTER USER jim IDENTIFIED BY '{password}' REPLACE '{old_password}';

Add the CREATEROLE permission to user jim.

1
ALTER USER jim CREATEROLE;

Set the enable_seqscan parameter associated with user jim to on. The setting takes effect in the next session.

1
ALTER USER jim SET enable_seqscan TO on;

Reset the enable_seqscan parameter for user jim.

1
ALTER USER jim RESET enable_seqscan;

Lock the jim account.

1
ALTER USER jim ACCOUNT LOCK;

Links

CREATE ROLE, CREATE USER, DROP USER