Note
This view is introduced since OceanBase Database V1.4.
Purpose
This view displays information about user privileges.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| GRANTEE | varchar(81) | NO | The username of the user to which the privilege is granted. |
| TABLE_CATALOG | varchar(512) | NO | The name of the catalog to which the table belongs. |
| 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 privileges granted to the user.
obclient > SELECT * FROM information_schema.USER_PRIVILEGES;
The query result is as follows:
+-------------+---------------+----------------+--------------+
| GRANTEE | TABLE_CATALOG | PRIVILEGE_TYPE | IS_GRANTABLE |
+-------------+---------------+----------------+--------------+
| 'test2'@'%' | def | USAGE | NO |
+-------------+---------------+----------------+--------------+
1 row in set