pgsql: injection_points: Add support for string comparison in condition

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: injection_points: Add support for string comparison in condition
Date: 2026-08-14 05:46:35
Message-ID: E1wukkU-00000000VbQ-32oJ@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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 <samimseih(at)gmail(dot)com>
Reviewed-by: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Reviewed-by: Michael Paquier <michael(at)paquier(dot)xyz>
Discussion: https://postgr.es/m/CAA5RZ0tsGHu2h6YLnVu4HiK05q+gTE_9WVUAqihW2LSscAYS-g@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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2026-08-14 06:15:56 pgsql: Add string-based injection point wait in 051_effective_wal_level
Previous Message Michael Paquier 2026-08-14 00:57:25 pgsql: Fix thinko in error of algorithm type lookup for channel binding