permissions - Reshift grants verification HAS_TABLE_PRIVILEGE fails -
i'm fighting redshit grants groups, schemas, default privileges. when try check correct using has_table_privilege
select tablename, has_table_privilege('analyst', tablename, 'select') select, has_table_privilege('analyst', tablename, 'insert') insert, has_table_privilege('analyst', tablename, 'update') update, has_table_privilege('analyst', tablename, 'delete') delete, has_table_privilege('analyst', tablename, 'references') references pg_tables schemaname='datalab' order tablename
i :
an error occurred when executing sql command: select tablename, has_table_privilege('analyst', tablename, 'select') select, has_table_privilege('analyst', tablena... [amazon](500310) invalid operation: relation "dss__transaction" not exist; execution time: 0.2s 1 statement failed.
what hell happening here ?
i tried , query failed on first result pg_tables
. in case because needed explicitly state schema each table in. worked me:
with cte ( select schemaname+'.'+tablename table_name pg_tables schemaname = 'datalab' ) select table_name, has_table_privilege('analyst', table_name, 'select') select, has_table_privilege('analyst', table_name, 'insert') insert, has_table_privilege('analyst', table_name, 'update') update, has_table_privilege('analyst', table_name, 'delete') delete, has_table_privilege('analyst', table_name, 'references') references cte order table_name asc;
Comments
Post a Comment