Skip to main content

Vertica Privilege Queries

  • November 6, 2014
  • 3 replies
  • 19 views

Kaushal_Sharma
Hi i am totally new to vertica. I want to know if i have create privilege to create objects(tables,schema,sequence) in vertica. What is the query we use to view this

3 replies

Adrian_Oprea
Forum|alt.badge.img
  • Participating Frequently
  • November 6, 2014
Use this script : 
SELECT 'GRANT ' || REPLACE(privileges_description, '*', '') || ' ON ' ||       COALESCE(object_schema, '') || '.' || object_name || ' TO ' ||
       grantee || ';' as GRANTS
  FROM v_catalog.grants
 WHERE COALESCE(privileges_description, '') > ''
&nbsp;ORDER BY 1;<BR />
or go to http://www.verticablog.com/extract-user-privilages-definition-vertica/#.VFt5TPnF8uc
to get the script


Kaushal_Sharma
  • Author
  • New Participant
  • November 6, 2014
this is same as select * from grants

but when i fire this query it gives information about a role...so the next the question is how to derive the role description


Adrian_Oprea
Forum|alt.badge.img
  • Participating Frequently
  • November 6, 2014
Try this 
http://www.verticablog.com/extract-roles-definition-vertica/#.VFuHPfnF8uc
SELECT 'CREATE ROLE ' || name || ' ;' AS ROLESFROM v_catalog.roles
WHERE name NOT IN ('public', 'dbadmin', 'pseudosuperuser', 'dbduser')
ORDER BY 1;