我正在尝试在我们只能访问 View 的共享数据库上应用数据屏蔽策略。但是我也向数据库提供了授权。我无法应用此屏蔽策略
这是我的代码
create or replace masking policy Policy_name as (val string) returns string ->
case
when current_role() in ('SECURITYADMIN') then val
else '*********'
end;
alter table if exists TABLE_NAME modify column PHN_NUMBER set MASKING POLICY Policy_name PHN_NUMBER;
错误:
SQL execution error: Creating masking_policy on shared database 'DATABASE_NAME' is not allowed.
最佳答案
limitation of DATA MASKING section说你不能这样做。
A data sharing consumer cannot apply a masking policy to a shared database or table. As a workaround, import the shared database or table and apply the masking policy to a local view on that shared table column.
关于database - 共享数据库上的数据屏蔽策略错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69993417/