Skip to main content
Question

How to find out sequence's grant information that who is have the grant about the table?

  • September 7, 2020
  • 1 reply
  • 5 views

HyeontaeJu
Forum|alt.badge.img+2

How to find out sequence's grant information that who is have the grant about the table?

1 reply

Jim_Knicely
Forum|alt.badge.img+2
  • Participating Frequently
  • September 7, 2020

Check the GRANTS system table.

Example:

dbadmin=> CREATE USER HyeontaeJu;
CREATE USER
dbadmin=> CREATE USER jim;
CREATE USER
dbadmin=> CREATE SEQUENCE some_seq;
CREATE SEQUENCE
dbadmin=> GRANT SELECT ON SEQUENCE some_seq TO HyeontaeJu, jim;
GRANT PRIVILEGE
dbadmin=> SELECT grantee, privileges_description FROM grants WHERE object_name = 'some_seq' AND object_type = 'SEQUENCE';
  grantee   | privileges_description
------------+------------------------
 dbadmin    | SELECT*, ALTER*, DROP*
 HyeontaeJu | SELECT
 jim        | SELECT
(3 rows)

Doc Page:
https://www.vertica.com/docs/latest/HTML/Content/Authoring/SQLReferenceManual/SystemTables/CATALOG/GRANTS.htm