ALTER USER

Function

ALTER USER modifies the attributes of a database user.

Precautions

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

Syntax

Parameters

For details about other parameters, see "Parameter Description" in CREATE ROLE and ALTER ROLE.

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 enable_seqscan to on (the setting will take 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