Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Data Masking policy error on shared database

I am trying to apply data masking policy on shared database where we have access to only views.However I provided grant to databases also.I am not able to apply this masking policy

here is my code

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;

error:

SQL execution error: Creating masking_policy on shared database 'DATABASE_NAME' is not allowed.
like image 569
Divya Avatar asked Aug 31 '26 14:08

Divya


1 Answers

the limitation of DATA MASKING section says you cannot do this.

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.

like image 88
Simeon Pilgrim Avatar answered Sep 03 '26 10:09

Simeon Pilgrim



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!