Alter User

Modifies user properties and permissions.

ALTER USER username
    [ WITH PASSWORD 'password' ]
    [ CREATEDB | NOCREATEDB ] [ CREATEUSER | NOCREATEUSER ]
    [ VALID UNTIL 'abstime' ]

Use the ALTER USER to change the attributes and permissions of a PostgreSQL database user.

To create and remove PostgreSQL database users, use the CREATE USER command and the DROP USER command, respectively.

The following example changes the password for user mark:

booktown=# ALTER USER mark WITH PASSWORD 'ml0215em';
ALTER USER

The next example demonstrates changing the password expiration date for the user mark:

booktown=# ALTER USER mark VALID UNTIL 'Dec 24 2012';
ALTER USER