
.. _role_table_grants:

role_table_grants
================================

视图\ ``role_table_grants``\ 标识所有在表或视图上授予的特权，这些特权的授予者或者被授予者是一个当前已被启用的角色。更多信息可以在\ ``table_privileges``\ 中找到。这个视图和\ ``table_privileges``\ 之间的唯一实质性区别是：这个视图忽略那些以授予给\ ``PUBLIC``\ 的方式使当前用户获得其访问权限的表。

.. table:: role_table_grants列
      :name: id-1.5.4.7.40.3
      :widths: 3 2 3 
      :class: longtable

      +--------------------+--------------------+--------------------------------------+
      | 名称               | 数据类型           | 描述                                 |
      +====================+====================+======================================+
      | ``grantor``        | ``sql_identifier`` | 授予该特权的角色名                   |
      +--------------------+--------------------+--------------------------------------+
      | ``grantee``        | ``sql_identifier`` | 被授予该特权的角色名                 |
      +--------------------+--------------------+--------------------------------------+
      | ``table_catalog``  | ``sql_identifier`` | 包含该表的数                         |
      |                    |                    | 据库名（总是当前数据库）             |
      +--------------------+--------------------+--------------------------------------+
      | ``table_schema``   | ``sql_identifier`` | 包含该表的模式名                     |
      +--------------------+--------------------+--------------------------------------+
      | ``table_name``     | ``sql_identifier`` | 表名称                               |
      +--------------------+--------------------+--------------------------------------+
      | ``privilege_type`` | ``character_data`` | 该特权                               |
      |                    |                    | 的类型：\ ``SELECT``\ 、             |
      |                    |                    | ``INSERT``\ 、                       |
      |                    |                    | \ ``UPDATE``\ 、                     |
      |                    |                    | ``DELETE``\ 、                       |
      |                    |                    | \ ``TRUNCATE``\ 、                   |
      |                    |                    | ``REFERENCES``\                      |
      |                    |                    | 或\ ``TRIGGER``                      |
      +--------------------+--------------------+--------------------------------------+
      | ``is_grantable``   | ``yes_or_no``      | 如果该                               |
      |                    |                    | 特权是可授予的，则为\ ``YES``\ ，    |
      |                    |                    | 否则为\ ``NO``                       |
      +--------------------+--------------------+--------------------------------------+
      | ``with_hierarchy`` | ``yes_or_no``      | 在 SQL                               |
      |                    |                    | 标准中，\ ``WITH HIERARCHY OPTION``\ |
      |                    |                    | 是一个独立                           |
      |                    |                    | 的（子）特权，它允许在表             |
      |                    |                    | 继承层级上的特定操作。在             |
      |                    |                    | KingbaseES                           |
      |                    |                    | 中，这被包括在\                      |
      |                    |                    | ``SELECT``\ 特权中，因此             |
      |                    |                    | 这一列在特权为\ ``SELECT``\          |
      |                    |                    | 时显示\ ``YES``\ ，                  |
      |                    |                    | 其他时候显示\ ``NO``\ 。             |
      +--------------------+--------------------+--------------------------------------+
