pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: injection_points: Introduce runtime conditions
Date: Mon, 08 Apr 2024 00:48:00 +0000
Message-ID: <E1rtdB1-0012vR-RD@gemulon.postgresql.org> (raw)

injection_points: Introduce runtime conditions

This adds a new SQL function injection_points_set_local() that can be
used to force injection points to be run only in the process where they
are attached.  This is handy for SQL tests to:
- Detach automatically injection points when the process exits.
- Allow tests with injection points to run concurrently with other test
suites, so as such modules do not have to be marked with
NO_INSTALLCHECK.

Currently, the only condition that can be registered is for a PID.
This could be extended to more kinds later, if required, like database
names/OIDs, roles, or more concepts I did not consider.

Using a single function for SQL scripts is an idea from Heikki
Linnakangas.

Reviewed-by: Andrey Borodin
Discussion: https://postgr.es/m/ZfP7IDs9TvrKe49x@paquier.xyz

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f587338dec87d3c35b025e131c5977930ac69077

Modified Files
--------------
.../injection_points/expected/injection_points.out |  77 +++++++++
.../injection_points/injection_points--1.0.sql     |  11 ++
.../modules/injection_points/injection_points.c    | 176 +++++++++++++++++++++
.../injection_points/sql/injection_points.sql      |  20 +++
src/tools/pgindent/typedefs.list                   |   1 +
5 files changed, 285 insertions(+)



Message-ID: <E1rtdB1-0012vR-RD@gemulon.postgresql.org>
Permalink:  ../E1rtdB1-0012vR-RD@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1rtdB1-0012vR-RD@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: injection_points: Introduce runtime conditions
  In-Reply-To: <E1rtdB1-0012vR-RD@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox