Mark P
Mark P

Reputation: 33

Insufficient privileges to drop schema

Trying to grant a role access to drop a schema from a database in Snowflake. What grants do I need to apply?

Currently if we try to execute this statement for the user: DROP SCHEMA IF EXISTS 'schemaname_123'

We get this error: SQL access control error: Insufficient privileges to operate on schema 'schemaname_123'

The role currently has these grants on the database GRANT USAGE, MONITOR, CREATE SCHEMA ON DATABASE RAW TO ROLE INGESTION_ROLE;

Upvotes: 3

Views: 1883

Answers (1)

Elad Kalif
Elad Kalif

Reputation: 16139

The DROP privilege is tied to the object owner.

To drop a schema, you must be using a role that has ownership privilege on the schema.

Note that granting ownership in fact transfer the ownership to another role.

grant ownership on schema schemaname_123 to role INGESTION_ROLE;

Upvotes: 3

Related Questions