# 36.37. role\_table\_grants

檢視表 role\_table\_grants 列出會授權者或被授權者為目前查詢的角色的資料表或檢視表所關連的所有權限。更多資訊可以參考在 table\_privileges 裡。此檢視表與 table\_privileges 之間唯一有效的區別是，此檢視表不包含了透過授權給 PUBLIC 的方式使目前角度有權存取的資料表。

#### **Table 36.35. `role_table_grants` Columns**

| <p>Column Type</p><p>Description</p>                                                                                                                                                                                                                                                                                                                                                              |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><code>grantor</code> <code>sql\_identifier</code></p><p>Name of the role that granted the privilege</p>                                                                                                                                                                                                                                                                                        |
| <p><code>grantee</code> <code>sql\_identifier</code></p><p>Name of the role that the privilege was granted to</p>                                                                                                                                                                                                                                                                                 |
| <p><code>table\_catalog</code> <code>sql\_identifier</code></p><p>Name of the database that contains the table (always the current database)</p>                                                                                                                                                                                                                                                  |
| <p><code>table\_schema</code> <code>sql\_identifier</code></p><p>Name of the schema that contains the table</p>                                                                                                                                                                                                                                                                                   |
| <p><code>table\_name</code> <code>sql\_identifier</code></p><p>Name of the table</p>                                                                                                                                                                                                                                                                                                              |
| <p><code>privilege\_type</code> <code>character\_data</code></p><p>Type of the privilege: <code>SELECT</code>, <code>INSERT</code>, <code>UPDATE</code>, <code>DELETE</code>, <code>TRUNCATE</code>, <code>REFERENCES</code>, or <code>TRIGGER</code></p>                                                                                                                                         |
| <p><code>is\_grantable</code> <code>yes\_or\_no</code></p><p><code>YES</code> if the privilege is grantable, <code>NO</code> if not</p>                                                                                                                                                                                                                                                           |
| <p><code>with\_hierarchy</code> <code>yes\_or\_no</code></p><p>In the SQL standard, <code>WITH HIERARCHY OPTION</code> is a separate (sub-)privilege allowing certain operations on table inheritance hierarchies. In PostgreSQL, this is included in the <code>SELECT</code> privilege, so this column shows <code>YES</code> if the privilege is <code>SELECT</code>, else <code>NO</code>.</p> |
