Top
Enterprise Postgres 16 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.

  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

    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.

  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

Note

Only database superusers can configure masking policies.