How do I view grants on Redshift

前端 未结 6 963
半阙折子戏
半阙折子戏 2020-12-02 10:22

I\'d like to view grants on redshifts.

I found this view for postgres:

CREATE OR REPLACE VIEW view_all_grants AS 
SELECT 
  use.usename as subject, 
         


        
6条回答
  •  攒了一身酷
    2020-12-02 11:21

    Something along the lines off:

    select tablename, 
       HAS_TABLE_PRIVILEGE(tablename, 'select') as select,
       HAS_TABLE_PRIVILEGE(tablename, 'insert') as insert,
       HAS_TABLE_PRIVILEGE(tablename, 'update') as update,
       HAS_TABLE_PRIVILEGE(tablename, 'delete') as delete, 
       HAS_TABLE_PRIVILEGE(tablename, 'references') as references 
    from pg_tables where schemaname='public' order by tablename;
    

    gives me all I need.

提交回复
热议问题