Top
Enterprise Postgres 16 Operation Guide

8.2.4 Enabling and Disabling a Masking Policy

An example of the operation on the server is shown below.

  1. Disable a masking policy
    Execute the pgx_enable_confidential_policy system management function to disable a masking policy.

    postgres=# select pgx_enable_confidential_policy(table_name := 't1', policy_name := 'p1', enable := 'f');
     pgx_enable_confidential_policy 
    ---------------------------------
     t
    (1 row)
  2. Confirm the displayed data
    Confirm that the original data is displayed by disabling the masking policy.

    postgres=# select * from t1;
     c1 |      c2       
    ----+---------------
      1 | 012-3456-7890
      2 | 012-3456-7891
      3 | 012-3456-7892
    (3 row)
  3. Enable a masking policy
    Execute the pgx_enable_confidential_policy system management function to enable a masking policy.

    postgres=# select pgx_enable_confidential_policy(table_name := 't1', policy_name := 'p1', enable := 't');
     pgx_enable_confidential_policy 
    ---------------------------------
     t
    (1 row)
  4. Confirm the displayed data
    Confirm that the masking target data has been correctly changed.

    postgres=# select * from t1;
     c1 |      c2       
    ----+---------------
      0 | 012-****-****
      0 | 012-****-****
      0 | 012-****-****
    (3 row)

See