如何在AWS Redshift中为用户授予特定Schema的Alter Table权限
AWS Redshift 特定Schema下所有表Alter权限配置方法
你之前的操作之所以会给角色全局Alter Table权限,是因为grant alter table to role testingaltertablerole;这条语句没有指定Schema范围,会默认对所有Schema生效。要实现仅特定Schema的权限,需要按以下步骤配置:
- 首先确保角色拥有目标Schema的访问权限(必须步骤,否则无法操作Schema内的表):
grant usage on schema your_target_schema to role testingaltertablerole; - 授予角色目标Schema下现有所有表的Alter权限:
grant alter on all tables in schema your_target_schema to role testingaltertablerole; - (可选但建议)授予角色目标Schema下未来新建表的Alter权限,避免后续创建的表需要重复授权:
grant alter on future tables in schema your_target_schema to role testingaltertablerole; - 最后将角色赋予用户(这部分你已经完成,可忽略):
grant role testingaltertablerole to testingaltertableuser;
替换上述代码中的your_target_schema为你实际需要授权的Schema名称即可。
内容的提问来源于stack exchange,提问作者Abednego Santoso
相关产品推荐
相关产品推荐

