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

时间:2024-01-23 20:09:20

语法格式

1
2
3
4
ALTER DEFAULT PRIVILEGES
    [ FOR { ROLE | USER } target_role [, ...] ]
    [ IN SCHEMA schema_name [, ...] ]
    abbreviated_grant_or_revoke;
  • 其中abbreviated_grant_or_revoke子句用于指定对哪些对象进行授权或回收权限。
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    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子句用于对表授权。
    1
    2
    3
    4
    5
    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子句用于对序列授权。
    1
    2
    3
    4
    5
    GRANT { { SELECT | UPDATE | USAGE | ALTER | DROP | COMMENT } 
        [, ...] | ALL [ PRIVILEGES ] }
        ON SEQUENCES 
        TO { [ GROUP ] role_name | PUBLIC } [, ...]
        [ WITH GRANT OPTION ]
    
  • 其中grant_on_functions_clause子句用于对函数授权。
    1
    2
    3
    4
    GRANT { { EXECUTE | ALTER | DROP | COMMENT } [, ...] | ALL [ PRIVILEGES ] }
        ON FUNCTIONS 
        TO { [ GROUP ] role_name | PUBLIC } [, ...]
        [ WITH GRANT OPTION ]
    
  • 其中grant_on_types_clause子句用于对类型授权。
    1
    2
    3
    4
    GRANT { { USAGE | ALTER | DROP | COMMENT } [, ...] | ALL [ PRIVILEGES ] }
        ON TYPES 
        TO { [ GROUP ] role_name | PUBLIC } [, ...]
        [ WITH GRANT OPTION ]
    
  • 其中grant_on_client_master_keys_clause子句用于对客户端主密钥授权。
    1
    2
    3
    4
    GRANT { { USAGE | DROP } [, ...] | ALL [ PRIVILEGES ] }
        ON CLIENT_MASTER_KEYS
        TO { [ GROUP ] role_name | PUBLIC } [, ...]
        [ WITH GRANT OPTION ]
    
  • 其中grant_on_column_encryption_keys_clause子句用于对列加密密钥授权。
    1
    2
    3
    4
    GRANT { { USAGE | DROP } [, ...] | ALL [ PRIVILEGES ] }
        ON COLUMN_ENCRYPTION_KEYS
        TO { [ GROUP ] role_name | PUBLIC } [, ...]
        [ WITH GRANT OPTION ]
    
  • 其中revoke_on_tables_clause子句用于回收表对象的权限。
    1
    2
    3
    4
    5
    6
    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子句用于回收序列的权限。
    1
    2
    3
    4
    5
    6
    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子句用于回收函数的权限。
    1
    2
    3
    4
    5
    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子句用于回收类型的权限。
    1
    2
    3
    4
    5
    REVOKE [ GRANT OPTION FOR ]
        { { USAGE | ALTER | DROP | COMMENT } [, ...] | ALL [ PRIVILEGES ] }
        ON TYPES 
        FROM { [ GROUP ] role_name | PUBLIC } [, ...]
        [ CASCADE | RESTRICT | CASCADE CONSTRAINTS ]
    
support.huaweicloud.com/devg-v1-gaussdb/gaussdb_devg_0486.html