I created a user ANALYST_USER and granted a role ANALYST.
When I tried to create a table in the TEST_DB, I got a following error message: Unable to create table TEST. SQL access control error: Insufficient privileges to operate on schema 'PUBLIC'

Here are the statements I wrote before trying to create a table using the ANALYST_USER account.
USE ROLE SECURITYADMIN;
-- Create Role-- CREATE ROLE ANALYST
-- Database-- GRANT USAGE ON DATABASE TEST_DB TO ROLE ANALYST;
-- Schema-- GRANT USAGE, MONITOR ON ALL SCHEMAS IN DATABASE TEST_DB TO ROLE ANALYST; GRANT USAGE, MONITOR ON FUTURE SCHEMAS IN DATABASE TEST_DB TO ROLE ANALYST;
-- Warehouse-- GRANT USAGE ON WAREHOUSE TEST_WH TO ROLE ANALYST; GRANT USAGE ON WAREHOUSE TEST_WH TO ROLE ANALYST;
-- Tables/Views-- GRANT SELECT ON ALL TABLES IN DATABASE TEST_DB TO ROLE ANALYST; GRANT SELECT ON FUTURE TABLES IN DATABASE TEST_DB TO ROLE ANALYST;
-- User -- GRANT ROLE ANALYST to USER ANALYST_USER;
Does anyone know how to solve this issue?
It is because the role was missing create table rights on the public schema. You just have usage and monitor privileges in your schema grant. So, GRANT CREATE TABLE ON SCHEMA TEST_DB.PUBLIC TO ROLE ANALYST; would have solved your issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With