Result set batch filter - Postgres

A result set batch filter gets invoked whenever a result set is being sent by the database server, and the connection specifies a batch size. Result set batch filters can modify the result set, hide or add rows, modify specific values, etc... The only limitations are typically that you do not want to confuse the database client, which expects data to look a certain way.

Each packet represents one or more rows in a result set, up to either the number specified in the connection configuration under Result set batch size (rows), or the approximate amount of memory specified in the connection configuration under Result set batch size (bytes).

Parameters

  • User pattern : optional. If specified, only execute the filter if the current database user matches the specified user(s). If the given value starts with regex: then the rest of the value is compiled as a Java regular expression. For instance: regex:(jdoe)|(anewman)

  • Schema pattern : optional. If specified, only execute the filter if the result set contains at least one column from a table in the specified schema(s). If the given value starts with regex: then the rest of the value is compiled as a Java regular expression. For instance: regex:(accounting)|(acct_\p{Alnum}+)

  • Table pattern : optional. If specified, only execute the filter if the result set contains at least one column from the specified table(s). If the given value starts with regex: then the rest of the value is compiled as a Java regular expression. For instance: regex:(customers)|(cust_[0-9]+)

  • Query pattern : optional. If specified, specify which SQL query should be active for this filter to be executed. If the given value starts with regex: then the rest of the value is compiled as a Java regular expression. For instance: regex:^select.+from (customers)|(cust_[0-9]+).*

  • Client IPs: optional. A list of IP addresses (IP4 and/or IP6) and/or regular expressions for IP addresses, for instance:
    12.34.56.78
    1234:5678:90ab::01
    regex:98\.76\..*
    regex:9876:5432:.*

Context

The usual context.packet variable will always be a DataRowBatch packet.