ALTER USER

ALTER USER — 更改一个数据库角色

Synopsis

ALTER USER user_specification [ WITH ] option [ ... ]

其中 option 可以是:

      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 new_name

ALTER USER { user_specification | ALL } [ IN DATABASE database_name ] SET configuration_parameter { TO | = } { value | DEFAULT }
ALTER USER { user_specification | ALL } [ IN DATABASE database_name ] SET configuration_parameter FROM CURRENT
ALTER USER { user_specification | ALL } [ IN DATABASE database_name ] RESET configuration_parameter
ALTER USER { user_specification | ALL } [ IN DATABASE database_name ] RESET ALL

其中 user_specification 可以是:

    user_name
  | CURRENT_USER
  | SESSION_USER

兼容性

ALTER USER语句是一种 LightDB扩展。SQL 标准把用户的定义留给 实现来处理。

另见

ALTER ROLE