Top
Enterprise Postgres 16 Operation Guide

8.2.2 Changing a Masking Policy

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

  2. Change a masking policy
    Execute the pgx_alter_confidential_policy system management function to change a masking policy.
    The following values are changed in this example.
    - Content of change: Add a masking target
    - Masking target: Character type c2
    - Masking type: PARTIAL
    - Masking condition: 'VVVFVVVVFVVVV, VVV-VVVV-VVVV, *, 4, 11'

    postgres=# select pgx_alter_confidential_policy(table_name := 't1', policy_name := 'p1', action := 'ADD_COLUMN', column_name := 'c2', function_type := 'PARTIAL', function_parameters := 'VVVFVVVVFVVVV, VVV-VVVV-VVVV, *, 4, 11');
     pgx_alter_confidential_policy 
    --------------------------------
     t
    (1 row)
  3. 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