Amazon Redshift Grants - New table can't be accessed even though user has grants to all tables in schema

后端 未结 4 1686
心在旅途
心在旅途 2021-02-02 12:13

I have a bit of a funny situation in Amazon Redshift where I have a user X who has grant select on all tables in schema public, but once a new table is created, this grant doesn

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-02 13:04

    In Redshift tables and views do not automatically inherit the permissions of their parent schema. Your newly created tables are only accessible to the user who created them, and the superuser.

    In a recent patch to Redshift a new feature to grant default privileges was implemented that addresses this issue.

    Alter Default Privileges

    The following code snippet will grant select privileges only for all future tables in the sales schema to the sales_admin group. If you want this to apply to existing tables in a schema you will need to combine it with a second grant statement.

    alter default privileges in schema sales grant select on tables to group sales_admin;
    

提交回复
热议问题