redshift其实是基于Postgres8的

    所以以下操作用psql命令行就可以完成,在AWS上反而会报cannot use commit while connection is in auto-commit mode
    image.png

    image.png

    1. revoke create on schema public from public;
    2. create user t_viewer with password 'xxxxx';
    3. create group data_viewers;
    4. alter group data_viewers add user t_viewer;
    5. grant select on all tables in schema public to group data_viewers;
    6. alter default privileges in schema public grant select on tables to group data_viewers;

    :::tips alter default privileges 使往后创建的表默认有select权限 :::

    关键是需要revoke create on schema public from public,因为
    image.png