To grant permissions such as select privileges requires that you first have such permissions.
According to Vertica's site, the ability to GRANT requires:
- A superuser can grant privileges on all object types to other users.
- An object owner can grant privileges on the object to other users using the optional WITH GRANT OPTION clause.
A pseudo solution
Depending on who needs access, you can either use username, role, or PUBLIC (all).
Here are some example statements - as I have not worked out of vertica myself, I cannot test this
GRANT SELECT on all tables in schema myschema TO [user/role/PUBLIC] WITH GRANT OPTION;
GRANT PRIVILEGE
OR
GRANT SELECT on schema.TABLENAME TO [user/role/PUBLIC] WITH GRANT OPTION;
GRANT PRIVILEGE
it may also require GRANT USAGE on schema as well
Processing Request with Python
And to process it through sqlalchemy in a python script (see this question for caveats):
sSQL = "my sql grant statement(s)"
with oSuperEngine.begin() as conn:
conn.execute(sSQL)
conn.execute("COMMIT")