Amazon Redshift 自 2025 年 11 月 1 日起不再支援建立新的 Python UDF。如果您想要使用 Python UDF,請在該日期之前建立 UDF。現有 Python UDF 將繼續正常運作。如需詳細資訊,請參閱部落格文章
SVV_RLS_RELATION
使用 SVV_RLS_RELATION 來檢視受到 RLS 保護的所有關係的清單。
所有使用者都可看見 SVV_RLS_RELATION。超級使用者可以看見所有資料列;一般使用者只能看見自己的資料。如需更多詳細資訊,請參閱 系統資料表和檢視中資料的可見性。
資料表欄
| 欄名稱 | 資料類型 | 說明 |
|---|---|---|
| datname | text | 包含關聯的資料庫名稱。 |
| relschema | text | 包含關係之結構描述的名稱。 |
| relname | text | 關係的名稱。 |
| relkind | text | 關係的類型,例如資料表或檢視。 |
| is_rls_on | boolean | 參數,指出關係是否受到 RS 保護。 |
| is_rls_datashare_on | boolean | 此參數指出關係是否透過資料共用受 RLS 保護。 |
| rls_conjunction_type | character(3) | 指出關係是否與 and 或 or 結合 RLS 政策的參數。 |
| rls_datashare_conjunction_type | character(3) | 指出關係是否透過資料共用與 and 或 or 結合 RLS 政策的參數。 |
範例查詢
下列範例顯示 SVV_RLS_RELATION 的結果。
ALTER TABLE tickit_category_redshift ROW LEVEL SECURITY ON FOR DATASHARES; --Inspect RLS state on the relations using SVV_RLS_RELATION. SELECT datname, relschema, relname, relkind, is_rls_on, is_rls_datashare_on FROM svv_rls_relation ORDER BY relname; datname | relschema | relname | relkind | is_rls_on | is_rls_datashare_on | rls_conjunction_type | rls_datashare_conjunction_type -----------+-----------+--------------------------+---------+-----------+---------------------+----------------------+-------------------------------- tickit_db | public | tickit_category_redshift | table | t | t | and | and (1 row)