Top
Enterprise Postgres 17 Operation Guide

B.4.1 pgx_alter_confidential_policy

Description

Changes masking policies

Format

The format varies depending on the content to be changed. The format is shown below.

Argument

The argument varies depending on the content to be changed. Details are as follows.

Details about whether arguments can be omitted are as follows.

Argument

Mandatory or optional

ADD_COLUMN

DROP_COLUMN

MODIFY_EXPRESSION

MODIFY_COLUMN

SET_POLICY_DESCRIPTION

SET_COLUMN_DESCRIPTION

Full masking

Partial masking

Regular expression masking

Full masking

Partial masking

Regular expression masking

schema_name

Y

Y

Y

Y

Y

Y

Y

Y

Y

Y

table_name

N

N

N

N

N

N

N

N

N

N

policy_name

N

N

N

N

N

N

N

N

N

N

action

Y

Y

Y

N

N

N

N

N

N

N

column_name

N

N

N

N

-

N

N

N

-

N

function_type

Y

N

N

-

-

Y

N

N

-

-

expression

-

-

-

-

N

-

-

-

-

-

policy_description

-

-

-

-

-

-

-

-

N

-

column_description

-

-

-

-

-

-

-

-

-

N

function_parameters

-

N

-

-

-

-

N

-

-

-

regexp_pattern

-

-

N

-

-

-

-

N

-

-

regexp_replacement

-

-

N

-

-

-

-

N

-

-

regexp_flags

-

-

Y

-

-

-

-

Y

-

-

Y: Can be omitted; N: Cannot be omitted; -: Ignored when specified

Return value

Return value

Description

TRUE

Ended normally

FALSE

Ended abnormally

Execution example 1

Adding masking policy p1 to masking target c2

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)

Execution example 2

Deleting masking target c1 from masking policy p1

postgres=# select pgx_alter_confidential_policy(table_name := 't1', policy_name := 'p1', action := 'DROP_COLUMN', column_name := 'c1');
 pgx_alter_confidential_policy 
--------------------------------
 t
(1 row)

Execution example 3

Changing the masking condition for masking policy p1

postgres=# select pgx_alter_confidential_policy(table_name := 't1', policy_name := 'p1', action := 'MODIFY_EXPRESSION', expression := 'false');
 pgx_alter_confidential_policy 
--------------------------------
 t
(1 row)

Execution example 4

Changing the content of masking policy p1 set for masking target c2

postgres=# select pgx_alter_confidential_policy(table_name := 't1', policy_name := 'p1', action := 'MODIFY_COLUMN', column_name := 'c2', function_type := 'FULL');
 pgx_alter_confidential_policy 
--------------------------------
 t
(1 row)

Execution example 5

Changing the description of masking policy p1

postgres=# select pgx_alter_confidential_policy(table_name := 't1', policy_name := 'p1', action := 'SET_POLICY_DESCRIPTION', policy_description := 'this policy is an example.');
 pgx_alter_confidential_policy 
--------------------------------
 t
(1 row)

Execution example 6

Changing the description of masking target c2

postgres=# select pgx_alter_confidential_policy(table_name := 't1', policy_name := 'p1', action := 'SET_COLUMN_DESCRIPTION', column_name := 'c2', column_description := 'c2 column is FULL.');
 pgx_alter_confidential_policy 
--------------------------------
 t
(1 row)

Description

See

  • Refer to "String Constants" in the PostgreSQL Documentation for information on the strings to specify for arguments.

  • Refer to "POSIX Regular Expressions" in the PostgreSQL Documentation and check pattern, replacement, and flags for information on the values that can be specified for regexp_pattern, regexp_replacement, and regexp_flags.