Hello all,
How can we see the role definition.
What all privileges are granted to a role?
The roles system table does not show any of this data.
Roles definition
Moderator: NorbertKrupa
- JimKnicely
- Site Admin
- Posts: 1825
- Joined: Sat Jan 21, 2012 4:58 am
- Contact:
Re: Roles definition
Hi,
You can find the privileges for a role in the V_CATALOG.GRANTS table.
Example:
You can find the privileges for a role in the V_CATALOG.GRANTS table.
Example:
Code: Select all
dbadmin=> CREATE TABLE test (c1 INT);
CREATE TABLE
dbadmin=> CREATE ROLE test_role;
CREATE ROLE
dbadmin=> GRANT USAGE ON SCHEMA schema1 TO test_role;;
GRANT PRIVILEGE
dbadmin=> GRANT SELECT ON test TO test_role;
GRANT PRIVILEGE
dbadmin=> SELECT grantor, privileges_description, object_name, object_type, grantee FROM v_catalog.grants WHERE grantee = 'test_role';
grantor | privileges_description | object_name | object_type | grantee
---------+------------------------+-------------+-------------+-----------
dbadmin | USAGE | schema1 | SCHEMA | test_role
dbadmin | SELECT | test | TABLE | test_role
(2 rows)
Jim Knicely
Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.
Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.
Re: Roles definition
That worked like a charm
Thanks Jim
Thanks Jim