欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Redshift使用技巧和常用语句

程序员文章站 2022-07-01 08:26:41
...

创建用户

create user dev with password 'xxxxxx';

创建组并加入

create group data_viewer;
alter group data_viewer add user dev;

给组spectrum库的只读权限

revoke create on schema spectrum from group data_viewer;
grant usage on schema spectrum to group data_viewer;
grant select on all tables in schema spectrum to group data_viewer;
alter default privileges in schema spectrum grant select on tables to group data_viewer;

给某个库的owner权限

alter schema spectrum owner to dev;

开启Redshift的spectrum功能

create external schema pre_spectrum 
from data catalog 
database 'pre_spectrumdb' 
iam_role 'arn:aws-cn:iam::xxxxxx:role/redshift-spectrum'
create external database if not exists;