如何显示Redshift Spectrum(外部架构)格兰特?

时间:2019-04-01 11:31:40

标签: amazon-redshift amazon-redshift-spectrum

This post对于显示Redshift GRANTS非常有用,但不能在外部表/架构上显示GRANTS。

如何显示外部架构(和相对表)特权?

1 个答案:

答案 0 :(得分:0)

由于在外部表中仅可以select个数据,这足以检查对外部表的usage权限:

SELECT schemaname, objectname, usename,
       has_schema_privilege(usrs.usename, schemaname, 'usage')  AS usage
FROM(
    SELECT schemaname, tablename AS objectname, schemaname + '.' + tablename AS fullobj
    FROM SVV_EXTERNAL_TABLES
    ) AS objs,(SELECT * FROM pg_user) AS usrs