ALTER USER username [ WITH PASSWORD 'password' ] [ CREATEDB | NOCREATEDB ] [ CREATEUSER | NOCREATEUSER ] [ VALID UNTIL 'abstime' ]
This parameter takes the name of the account to be modified.
If you are changing an account's password, use this parameter to provide the database with a new password for the account.
Use these keywords to determine whether or not an account has permission to create databases. CREATEDB will specify that the account is able to create databases, whereas NOCREATEDB will deny a user the privileges needed to create databases.
Use these keywords to set whether or not a user has permission to create other users.
Superuser | |
---|---|
Specifying that an account is able to create other users also automatically classifies the user as a superuser on the database; this can be quite the security risk if unintentional , as a superuser account can override other access restrictions. |
To force an account's password to expire after a certain amount of time, enter the date on which this should happen (and, optionally, the time).
Use the ALTER USER to change the attributes and permissions of a PostgreSQL user account.
Superusers only! | |
---|---|
Only a database superuser can change privileges and password expiration values with this command. Ordinary users are only permitted to change their password. |
To create and remove user accounts, use the CREATE USER command and the DROP USER command, respectively.