ALTER USER — change a database role
ALTER USERrole_specification
[ WITH ]option
[ ... ] whereoption
can be: SUPERUSER | NOSUPERUSER | CREATEDB | NOCREATEDB | CREATEROLE | NOCREATEROLE | INHERIT | NOINHERIT | LOGIN | NOLOGIN | REPLICATION | NOREPLICATION | BYPASSRLS | NOBYPASSRLS | CONNECTION LIMITconnlimit
| [ ENCRYPTED ] PASSWORD 'password
' | PASSWORD NULL | VALID UNTIL 'timestamp
' ALTER USERname
RENAME TOnew_name
ALTER USER {role_specification
| ALL } [ IN DATABASEdatabase_name
] SETconfiguration_parameter
{ TO | = } {value
| DEFAULT } ALTER USER {role_specification
| ALL } [ IN DATABASEdatabase_name
] SETconfiguration_parameter
FROM CURRENT ALTER USER {role_specification
| ALL } [ IN DATABASEdatabase_name
] RESETconfiguration_parameter
ALTER USER {role_specification
| ALL } [ IN DATABASEdatabase_name
] RESET ALL whererole_specification
can be:role_name
| CURRENT_USER | SESSION_USER
ALTER USER
is now an alias for ALTER ROLE.
The ALTER USER
statement is a PostgreSQL extension. The SQL standard leaves the definition of users to the implementation.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.