Built-in PostgreSQL driver support plugin
For instructions on how to enable/disable Drop Constraints, Drop Indexes, and Disable Triggers on PostgreSQL jobs, see API Calls for Managing Masking Job Driver Support Tasks.
Unlike other database platforms such as Oracle and MSSQL, PostgreSQL doesn't support the disabling of constraints. Therefore, this plugin has a Drop Constraints task instead of a Disable Constraints task.
Tasks
For in-place jobs:
Drop Constraints drops and re-creates constraints on masked columns only.
Drop Indexes drops and re-creates indexes on masked columns only (except for indexes automatically generated by PostgreSQL to support a primary key or unique constraint - those are dropped by Drop Constraints).
Disable Triggers disables and re-enables triggers on tables with masked columns only.
For on-the-fly jobs, the tasks will execute on all columns and tables in the ruleset.
Task Execution Order
The order of task execution for built-in driver support plugins is fixed/unmodifiable.
The order of the tasks is as follows:
Pre-job:
Drop Constraints
Drop Indexes
Disable Triggers
Post-job (mirrored order):
Enable Triggers
Create Indexes
Enable Constraints
Important Considerations
If masking primary key fields, use the same deterministic algorithms on primary key fields that reference each other so that referential integrity is maintained when the masking transformation completes and all constraints are re-created.
If dropping indexes on masked fields with constraints is desired, enable both Drop Constraints and Drop Indexes. PostgreSQL automatically creates unique indexes to support primary key and unique constraints. Those indexes cannot be dropped by the Drop Indexes task, but enabling Drop Constraints will allow it to drop those indexes when the constraints they support are dropped.
Known Limitations
If both a foreign key column and the primary key or unique column it references are not masked with the same deterministic algorithm (guaranteeing referential integrity), the job will fail due to an integrity constraint violation.
If masking a field that is a primary key or has a unique constraint, and Drop Indexes is the only task enabled, the job will fail. Drop Constraints must also be enabled so that it can drop the indexes PostgreSQL automatically creates to support constraints.