Note
This view is available starting with V1.4.
Purpose
This view displays table privileges.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| GRANTEE | varchar(81) | NO | The account name of the user to which privileges are granted. |
| TABLE_CATALOG | varchar(4096) | NO | The table catalog, which is fixed to def |
| TABLE_SCHEMA | varchar(128) | NO | The database name |
| TABLE_NAME | varchar(64) | NO | The table name |
| PRIVILEGE_TYPE | varchar(64) | NO | The privilege granted. |
| IS_GRANTABLE | varchar(3) | NO | Indicates whether the privilege can be granted to other users. |
Sample query
Query the table-level privileges granted to a user.
obclient [infotest]> SELECT * FROM information_schema.TABLE_PRIVILEGES;
The query is as follows:
+-------------+---------------+--------------+------------+----------------+--------------+
| GRANTEE | TABLE_CATALOG | TABLE_SCHEMA | TABLE_NAME | PRIVILEGE_TYPE | IS_GRANTABLE |
+-------------+---------------+--------------+------------+----------------+--------------+
| 'test1'@'%' | def | infotest | tbl1 | INSERT | NO |
| 'test1'@'%' | def | infotest | tbl1 | SELECT | NO |
+-------------+---------------+--------------+------------+----------------+--------------+
2 rows in set