Top
Enterprise Postgres 17 SP1 Operation Guide

8.2 Usage Method

Preparation

The following preparation is required to use this feature.

  1. Set the postgresql.conf file parameters.

    Prepend "pgx_datamasking" to the shared_preload_libraries parameter.

    Be sure to add "pgx_datamasking" to the beginning of the parameter "shared_preload_libraries".

  2. Restart the instance.

  3. 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

    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. Only database superusers can configure masking policies.

The masking policy setting is explained in the following steps using an example.

  1. Creating a masking policy

  2. Changing a masking policy

  3. Confirming a masking policy

  4. Enabling and disabling a masking policy

  5. Deleting a masking policy