Note
This view is introduced since OceanBase Database V4.0.0.
Purpose
This view displays the column privilege information.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| GRANTEE | varchar(292) | NO | The username of the user to whom the access privilege was granted. |
| TABLE_CATALOG | varchar(512) | NO | The name of the directory where the table that contains the column is located. The value of this column is always def. |
| TABLE_SCHEMA | varchar(64) | NO | The database where the table that contains the column is located. |
| TABLE_NAME | varchar(64) | NO | The name of the table that contains the column. |
| COLUMN_NAME | varchar(64) | NO | The name of the column. |
| PRIVILEGE_TYPE | varchar(64) | NO | The granted privilege. It can be any privilege that is granted at the column level. |
| IS_GRANTABLE | varchar(3) | NO | YES: The user has the grant option.NO: The user does not have the grant option. |
Sample query
Query the user's column privilege information.
obclient [information_schema]> SELECT * FROM information_schema.COLUMN_PRIVILEGES;
The query result is as follows:
+-------------+---------------+--------------+------------+-------------+----------------+--------------+
| GRANTEE | TABLE_CATALOG | TABLE_SCHEMA | TABLE_NAME | COLUMN_NAME | PRIVILEGE_TYPE | IS_GRANTABLE |
+-------------+---------------+--------------+------------+-------------+----------------+--------------+
| 'user2'@'%' | def | test1 | tbl1 | c1 | INSERT | YES |
| 'user1'@'%' | def | test1 | tbl1 | c1 | SELECT | NO |
+-------------+---------------+--------------+------------+-------------+----------------+--------------+
2 rows in set
References
Query the column privileges granted to a user: mysql.columns_priv