Note
This view is introduced since OceanBase Database V1.4.
Purpose
This view displays information about table privileges.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| GRANTEE | varchar(81) | NO | The username of the user to which the privilege is granted. |
| TABLE_CATALOG | varchar(4096) | NO | The name of the catalog to which the table belongs. |
| 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 | The type of the privilege. |
| IS_GRANTABLE | varchar(3) | NO | Indicates whether the privilege can be granted. |
Sample query
Query the table-level privileges granted to the user.
obclient [infotest]> SELECT * FROM information_schema.TABLE_PRIVILEGES;
The query result is as follows:
+-------------+---------------+--------------+------------+----------------+--------------+
| 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