injection_points: Add support for string comparison in conditions

injection_points is extended so as a caller can attach a string value to
a point, checked with a value provided at runtime.  There are a couple
of use cases where this can be useful, to be able to target points for
specific object names.

PID and string conditions can be combined together, so as a point can be
allowed for a specific process and string value at the same time.

The condition string is capped at 255 characters.  As the attach SQL
function now takes an optional condition string, it is no longer STRICT,
and rejects NULL inputs.  Empty condition strings are also rejected, as
they don't make sense.

Author: Sami Imseih <[email protected]>
Reviewed-by: Bertrand Drouvot <[email protected]>
Reviewed-by: Michael Paquier <[email protected]>
Discussion: 
https://postgr.es/m/caa5rz0tsghu2h6ylnvu4hik05q+gte_9wvuaqihw2lsscay...@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0fd73cdffc18d3914311122bf4fbb5acbae626f3

Modified Files
--------------
.../injection_points/expected/injection_points.out | 43 ++++++++++++++++
.../injection_points/injection_points--1.0.sql     |  5 +-
.../modules/injection_points/injection_points.c    | 59 +++++++++++++++-------
.../modules/injection_points/injection_points.h    | 11 +++-
.../injection_points/sql/injection_points.sql      | 14 +++++
5 files changed, 110 insertions(+), 22 deletions(-)

Reply via email to