Data Redaction Functions

Data redaction functions are used to mask and protect sensitive data. Generally, you are advised to bind these functions to the columns to be redacted based on the data redaction syntax, rather than use them directly on query statements.

Redaction functions are recommended if you want to create redaction policies.

For details about how to use data redaction functions, see the examples in "Database Security Management > Managing Users and Their Permissions > Data Redaction" in the Developer Guide.

User-Defined Redaction Functions

You can use the PL/pgSQL language to customize redaction functions.

User-defined redaction functions must meet the following requirements:
  • The return type must be the same as the data type of the redacted column.
  • The functions can be pushed down.
  • In addition to the redaction format, only one column can be specified in the argument list for data redaction.
  • The functions only implement the formatting for specific data types and do not involve complex association operations with other table objects.

If either of the first two requirements is not met, an error will be reported when you create a redaction policy. If either of the last two requirements is not met, unexpected problems may occur in query execution results.