I am trying to assign SELECT
privilege to a group in Redshift. So I created a group and a user in that group:
CREATE GROUP data_viewers;
CREATE USER <user> PASSWORD '<password>' IN GROUP data_viewers;
Now I would like to allow this group to be able to read data from any table:
GRANT SELECT ON ALL TABLES IN SCHEMA PUBLIC TO GROUP data_viewers;
The command returns GRANT
. Now when I connect to Redshift as my newly created user and issue SELECT * FROM something.something;
I get:
permission denied for schema something
I tried granting permissions to something: GRANT SELECT ON ALL TABLES IN SCHEMA something TO GROUP data_viewers;
but this has not changed anything.
How can I allow users from my group to SELECT
data from any table in the schema?
Best Answer
You need the
USAGE
privilege (at least) for the schema as well:Related Postgres example:
Remember you only granted permissions to already existing tables. Does not apply to tables created later. To cover those, too:
Amazon Redshift implemented
DEFAULT PRIVILEGES
as well.Here is a complete cookbook for Postgres:
Be aware of some differences between mainline Postgres and Redshift! Redshift sticks to separate users and groups, while Postgres replaced that with the universal concept of roles:
And I am not sure how Redshift handles sequences ...