云数据库 GAUSSDB-ALTER USER:语法格式

时间:2024-11-02 18:45:37

语法格式

  • 修改用户的权限等信息。
    ALTER USER user_name [ [ WITH ] option [ ... ] ];
    ALTER USER user_name
        RENAME TO new_name;
    ALTER USER user_name [ IN DATABASE database_name ]
        SET configuration_parameter {{ TO | = } { value | DEFAULT }|FROM CURRENT};
    ALTER USER user_name
        [ IN DATABASE database_name ] RESET {configuration_parameter|ALL};

    其中option子句为。

    { CREATEDB | NOCREATEDB }
        | { CREATEROLE | NOCREATEROLE }
        | { INHERIT | NOINHERIT }
        | { AUDITADMIN | NOAUDITADMIN }
        | { SYSADMIN | NOSYSADMIN }
        | {MONADMIN | NOMONADMIN}
        | {OPRADMIN | NOOPRADMIN}
        | {POLADMIN | NOPOLADMIN}
        | { USEFT | NOUSEFT }
        | {  LOG IN | NOLOGIN }
        | { REPLICATION | NOREPLICATION }
        | {PERSISTENCE | NOPERSISTENCE}
        | CONNECTION LIMIT connlimit
        | [ ENCRYPTED | UNENCRYPTED ] PASSWORD { 'password' [EXPIRED] | DISABLE | EXPIRED }
        | [ ENCRYPTED | UNENCRYPTED ] IDENTIFIED BY { 'password' [ REPLACE 'old_password' | EXPIRED ] | DISABLE }
        | VALID BEGIN 'timestamp'
        | VALID UNTIL 'timestamp'
        | RESOURCE POOL 'respool'
        | USER GROUP 'groupuser'
        | PERM SPACE 'spacelimit'
        | TEMP SPACE 'tmpspacelimit'
        | SPILL SPACE 'spillspacelimit'
        | NODE GROUP logic_cluster_name
        | ACCOUNT { LOCK | UNLOCK }
        | PGUSER
  • 修改用户名。
    ALTER USER user_name 
        RENAME TO new_name;
  • 修改与用户关联的指定会话参数值。
    ALTER USER user_name [ IN DATABASE database_name ]
        SET configuration_parameter {{ TO | = } { value | DEFAULT }|FROM CURRENT};
  • 重置与用户关联的指定会话参数值。
    ALTER USER user_name 
        [ IN DATABASE database_name ] RESET {configuration_parameter|ALL};
support.huaweicloud.com/centralized-devg-v8-gaussdb/gaussdb-42-0527.html