云数据库 GaussDB-ALTER DEFAULT PRIVILEGES:语法格式

时间:2023-11-01 16:22:04

语法格式

ALTER DEFAULT PRIVILEGES    [ FOR { ROLE | USER } target_role [, ...] ]    [ IN SCHEMA schema_name [, ...] ]    abbreviated_grant_or_revoke;
  • 其中abbreviated_grant_or_revoke子句用于指定对哪些对象进行授权或回收权限。
    grant_on_tables_clause  | grant_on_sequences_clause  | grant_on_functions_clause  | grant_on_types_clause  | grant_on_client_master_keys_clause  | grant_on_column_encryption_keys_clause  | revoke_on_tables_clause  | revoke_on_sequences_clause  | revoke_on_functions_clause  | revoke_on_types_clause  | revoke_on_client_master_keys_clause  | revoke_on_column_encryption_keys_clause
  • 其中grant_on_tables_clause子句用于对表授权。
    GRANT { { SELECT | INSERT | UPDATE | DELETE | TRUNCATE | REFEREN CES  | ALTER | DROP | COMMENT | INDEX | VACUUM }     [, ...] | ALL [ PRIVILEGES ] }    ON TABLES     TO { [ GROUP ] role_name | PUBLIC } [, ...]    [ WITH GRANT OPTION ]
  • 其中grant_on_sequences_clause子句用于对序列授权。
    12345
    GRANT { { SELECT | UPDATE | USAGE | ALTER | DROP | COMMENT }     [, ...] | ALL [ PRIVILEGES ] }    ON SEQUENCES     TO { [ GROUP ] role_name | PUBLIC } [, ...]    [ WITH GRANT OPTION ]
  • 其中grant_on_functions_clause子句用于对函数授权。
    GRANT { { EXECUTE | ALTER | DROP | COMMENT } [, ...] | ALL [ PRIVILEGES ] }    ON FUNCTIONS     TO { [ GROUP ] role_name | PUBLIC } [, ...]    [ WITH GRANT OPTION ]
  • 其中grant_on_types_clause子句用于对类型授权。
    GRANT { { USAGE | ALTER | DROP | COMMENT } [, ...] | ALL [ PRIVILEGES ] }    ON TYPES     TO { [ GROUP ] role_name | PUBLIC } [, ...]    [ WITH GRANT OPTION ]
  • 其中grant_on_client_master_keys_clause子句用于对客户端主密钥授权。
    GRANT { { USAGE  | DROP } [, ...] | ALL [ PRIVILEGES ] }    ON CLIENT_MASTER_KEYS    TO { [ GROUP ] role_name | PUBLIC } [, ...]    [ WITH GRANT OPTION ]
  • 其中grant_on_column_encryption_keys_clause子句用于对列加密密钥授权。
    GRANT { { USAGE | DROP } [, ...] | ALL [ PRIVILEGES ] }    ON COLUMN_ENCRYPTION_KEYS     TO { [ GROUP ] role_name | PUBLIC } [, ...]    [ WITH GRANT OPTION ]
  • 其中revoke_on_tables_clause子句用于回收表对象的权限。
    REVOKE [ GRANT OPTION FOR ]    { { SELECT | INSERT | UPDATE | DELETE | TRUNCATE | REFERENCES | ALTER | DROP | COMMENT | INDEX | VACUUM }     [, ...] | ALL [ PRIVILEGES ] }    ON TABLES     FROM { [ GROUP ] role_name | PUBLIC } [, ...]    [ CASCADE | RESTRICT | CASCADE CONSTRAINTS ]
  • 其中revoke_on_sequences_clause子句用于回收序列的权限。
    123456
    REVOKE [ GRANT OPTION FOR ]    { { SELECT | UPDATE | USAGE | ALTER | DROP | COMMENT }     [, ...] | ALL [ PRIVILEGES ] }    ON SEQUENCES    FROM { [ GROUP ] role_name | PUBLIC } [, ...]    [ CASCADE | RESTRICT | CASCADE CONSTRAINTS ]
  • 其中revoke_on_functions_clause子句用于回收函数的权限。
    REVOKE [ GRANT OPTION FOR ]    { {EXECUTE | ALTER | DROP | COMMENT } [, ...] | ALL [ PRIVILEGES ] }    ON FUNCTIONS     FROM { [ GROUP ] role_name | PUBLIC } [, ...]    [ CASCADE | RESTRICT | CASCADE CONSTRAINTS ]
  • 其中revoke_on_types_clause子句用于回收类型的权限。
    REVOKE [ GRANT OPTION FOR ]    { { USAGE | ALTER | DROP | COMMENT } [, ...] | ALL [ PRIVILEGES ] }    ON TYPES     FROM { [ GROUP ] role_name | PUBLIC } [, ...]    [ CASCADE | RESTRICT | CASCADE CONSTRAINTS ]
support.huaweicloud.com/centralized-devg-v2-opengauss/devg_03_0490.html