Roles definition

Moderator: NorbertKrupa

Post Reply
User avatar
nnani
Master
Master
Posts: 302
Joined: Fri Apr 13, 2012 6:28 am
Contact:

Roles definition

Post by nnani » Wed Aug 21, 2013 8:47 am

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.
nnani........
Long way to go

You can check out my blogs at vertica-howto

User avatar
JimKnicely
Site Admin
Site Admin
Posts: 1822
Joined: Sat Jan 21, 2012 4:58 am
Contact:

Re: Roles definition

Post by JimKnicely » Wed Aug 21, 2013 1:24 pm

Hi,

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

Image

Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.

User avatar
nnani
Master
Master
Posts: 302
Joined: Fri Apr 13, 2012 6:28 am
Contact:

Re: Roles definition

Post by nnani » Wed Aug 21, 2013 1:52 pm

That worked like a charm :D

Thanks Jim
nnani........
Long way to go

You can check out my blogs at vertica-howto

Post Reply

Return to “Vertica Database Development”