ALTER USER (original) (raw)
This documentation is for an unsupported version of PostgreSQL.
You may want to view the same page for thecurrent version, or one of the other supported versions listed above instead.
ALTER USER — change a database role
Synopsis
ALTER USER rolespecification
[ WITH ] option
[ ... ]
where option
can be:
SUPERUSER | NOSUPERUSER
| CREATEDB | NOCREATEDB
| CREATEROLE | NOCREATEROLE
| INHERIT | NOINHERIT
| LOGIN | NOLOGIN
| REPLICATION | NOREPLICATION
| BYPASSRLS | NOBYPASSRLS
| CONNECTION LIMIT _`connlimit`_
| [ ENCRYPTED ] PASSWORD '_`password`_' | PASSWORD NULL
| VALID UNTIL '_`timestamp`_'
ALTER USER name
RENAME TO newname
ALTER USER { rolespecification
| ALL } [ IN DATABASE databasename
] SET configurationparameter
{ TO | = } { value
| DEFAULT }
ALTER USER { rolespecification
| ALL } [ IN DATABASE databasename
] SET configurationparameter
FROM CURRENT
ALTER USER { rolespecification
| ALL } [ IN DATABASE databasename
] RESET configurationparameter
ALTER USER { rolespecification
| ALL } [ IN DATABASE databasename
] RESET ALL
where rolespecification
can be:
_`rolename`_
| CURRENT_ROLE | CURRENT_USER | SESSION_USER
Description
ALTER USER
is now an alias for ALTER ROLE.
Compatibility
The ALTER USER
statement is a PostgreSQL extension. The SQL standard leaves the definition of users to the implementation.