Note
This view was introduced starting from V1.4.
Purpose
The information_schema.TABLE_PRIVILEGES view displays the information about table privileges.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| GRANTEE | varchar(81) | NO | Account name for the target to which privileges are assigned. |
| TABLE_CATALOG | varchar(4096) | NO | The table directory, which is fixed as def. |
| TABLE_SCHEMA | varchar(128) | NO | The name of the database. |
| TABLE_NAME | varchar(64) | NO | The name of the table. |
| PRIVILEGE_TYPE | varchar(64) | NO | Grants a privilege. |
| IS_GRANTABLE | varchar(3) | NO | Whether it can be granted to other users. |
Sample query
This topic describes the views that you can use to view the privileges granted to users at the table level.
obclient [infotest]> SELECT * FROM information_schema.TABLE_PRIVILEGES;
The following query example shows how to use the table functions:
+-------------+---------------+--------------+------------+----------------+--------------+
| GRANTEE | TABLE_CATALOG | TABLE_SCHEMA | TABLE_NAME | PRIVILEGE_TYPE | IS_GRANTABLE |
+-------------+---------------+--------------+------------+----------------+--------------+
| 'test2'@'%' | def | infotest | tbl1 | INSERT | NO |
| 'test2'@'%' | def | infotest | tbl1 | SELECT | NO |
+-------------+---------------+--------------+------------+----------------+--------------+
2 rows in set