Xi12
Xi12

Reputation: 1211

How to give create/alter stage privileges to a role

I have given grant all privileges to role svn_dev, but it is not giving access to create, alter and drop stage permissions across all schemas. How do I provide this to a role?

I have also tried

grant ownership on database DA_DEV to role svn_dev;

I get an error

SQL execution error: Dependent grant of privilege 'CREATE SCHEMA' on securable.

To revoke all dependent grants while transferring object ownership, use convenience command 'GRANT OWNERSHIP ON <target_objects> TO <target_role> REVOKE CURRENT GRANTS'.

How to give create stage permissions?

Upvotes: 2

Views: 4187

Answers (1)

Greg Pavlik
Greg Pavlik

Reputation: 11046

The error message gives a way to fix it in most cases. Try this:

grant ownership on database DA_DEV to role svn_dev revoke current grants;

If you can't revoke current grants because it would be too much work to re-issue the grants, you can explicitly revoke the grants that are preventing a change in ownership. You can check them using show grants.

You can grant create stage like this:

grant create stage on schema <DATABASE>.<SCHEMA> to role <ROLE>;

Upvotes: 2

Related Questions