如何授予用户访问 Redshift 中特定架构中的一个表的权限

mow*_*nay 2 amazon-redshift

以超级用户身份登录,如何授予用户访问特定架构下的特定表的权限。

我试过这个

表 this_schema.my_table 上的 GRANT SELECT TO my_user

但是当我以 my_user 身份登录时,我无法从表中进行选择。我不希望 my_user 有权访问 this_schema 中的任何其他表。

这可能吗?

小智 7

Yes its possible. You can use following command, to give select access of specific table to specific user.

GRANT SELECT on SCHEMA_NAME.TABLE_NAME TO USER_NAME;
Run Code Online (Sandbox Code Playgroud)

NOTE: user still list and describe other tables in the given schema.

  • 有什么方法可以限制用户查看、列出和描述给定模式中的其他表。考虑我有一个通用模式“销售”,并且我有两个有权访问该模式的用户(UserX 和 UserY)。在任何时候,UserX 或 UserY 都应该能够查看、访问和仅列出他们创建的表。有什么办法吗? (2认同)

Jon*_*ott 6

您还需要在架构上授予使用权

GRANT USAGE ON SCHEMA this_schema TO GROUP my_user;
Run Code Online (Sandbox Code Playgroud)