檢查欄位層級的安全性
愛達荷州外勤辦公室的 Amelia 回報,她在離開前查看站點的資料表時,發現有些預期會看到的資料無法看到,沒有提供更多細節。你想起她可能看不到特定欄位,因此決定透過系統欄位權限檢視表 SVV_COLUMN_PRIVILEGES,檢查是否對該資料表套用了任何欄位層級的安全性設定。
本練習屬於課程
Redshift 入門
練習說明
- 從系統欄位權限檢視表中選取
relation_name作為table_name、column_name、privilege_type作為query_type,以及identity_name作為user_or_role。 - 將結果篩選為只有
idaho_site_id資料表。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
-- Select the relation_name as table_name
SELECT relation_name AS ___,
column_name,
-- Select the column that targets the privilege
___ AS query_type,
-- Select the identity as user_or_role
___ AS user_or_role
-- From the system column privileges view
FROM ___
-- The table name is idaho_site_id
WHERE ___ = 'idaho_site_id';