Preparation
The following preparation is required to use this feature.
Set the postgresql.conf file parameters.
Prepend "pgx_datamasking" to the shared_preload_libraries parameter.
Restart the instance.
Execute CREATE EXTENSION for the database that will use this feature.
The target database is described as "postgres" here.
Use the psql command to connect to the "postgres" database.
Example
postgres=# CREATE EXTENSION pgx_datamasking; CREATE EXTENSION
Note
You must always prepend "pgx_datamasking" to the "shared_preload_libraries" parameter.
Information
Specify "false" for pgx_datamasking.enable to not use this feature. Data will not be masked even if a masking policy is configured. This feature becomes available again once "true" is specified for pgx_datamasking.enable. This setting can be made by specifying a SET statement or specifying a parameter in the postgresql.conf file.
Example
postgres=# SET pgx_datamasking.enable=false;
Hereafter, also perform this preparatory task for the "template1" database, so that this feature can be used by default when creating a new database.
Usage
To perform masking, a masking policy needs to be configured. The masking policy can be created, changed, confirmed, enabled, disabled or deleted during operation.
The procedures to perform these tasks are explained below with examples.
Creating a masking policy
Changing a masking policy
Confirming a masking policy
Enabling and disabling a masking policy
Deleting a masking policy
Note
Only database superusers can configure masking policies.