ALTER USER — 更改数据库角色
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_ROLE | CURRENT_USER | SESSION_USER
ALTER USER
现在是 ALTER ROLE
的别名。
ALTER USER
语句是 PostgreSQL 的扩展。 SQL 标准将用户的定义留给实现。
如果您在文档中发现任何不正确、与您使用特定功能的体验不符或需要进一步澄清的内容,请使用此表格报告文档问题。