Skip to main content
Question

How can i add DROP grant to user??

  • March 4, 2021
  • 1 reply
  • 8 views

ShawHale

I wanna add drop grant to user, so i execute this query
ref ) this user already had other grants(SELECT, UPDATE, DELETE) ,
GRANT DROP ON schema wmp_ep_product_dev to searchop_juhyeontae;
but the user doesn't have DROP privilige... https://19216811.cam/
In this case, how can i add DROP grant to user??

1 reply

Jim_Knicely
Forum|alt.badge.img+2
  • Participating Frequently
  • March 4, 2021

Look into inherited privileges...

https://www.vertica.com/docs/latest/HTML/Content/Authoring/AdministratorsGuide/DBUsersAndPrivileges/Privileges/InheritedPrivilegesOverview.htm

Example:

dbadmin=> CREATE SCHEMA s;
CREATE SCHEMA

dbadmin=> CREATE USER u;
CREATE USER

dbadmin=> GRANT USAGE ON SCHEMA s TO u;
GRANT PRIVILEGE

dbadmin=> GRANT DROP ON SCHEMA s TO u;
GRANT PRIVILEGE

dbadmin=> CREATE TABLE s.t(c INT);
CREATE TABLE

dbadmin=> \c - u
You are now connected as user "u".

dbadmin=> DROP TABLE s.t;
ROLLBACK 8959:  Insufficient privileges on t, drop privileges needed

dbadmin=> \c
You are now connected as user "dbadmin".

dbadmin=> ALTER TABLE s.t INCLUDE SCHEMA PRIVILEGES;
ALTER TABLE

dbadmin=> \c - u
You are now connected as user "u".

dbadmin=> DROP TABLE s.t;
DROP TABLE