Re: Add pg_get_injection_points() for information of injection points - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Add pg_get_injection_points() for information of injection points
Date
Msg-id aGXGHBjALCky3pfx@paquier.xyz
Whole thread Raw
In response to Re: Add pg_get_injection_points() for information of injection points  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Add pg_get_injection_points() for information of injection points
List pgsql-hackers
On Tue, Apr 15, 2025 at 08:00:50AM +0900, Michael Paquier wrote:
> On Mon, Apr 14, 2025 at 04:29:37PM +0300, Aleksander Alekseev wrote:
>> If I didn't miss anything, all SQL functions dealing with injection
>> points are gathered in injection_points extension so IMO
>> pg_get_injection_points() belongs there. It would be awkward to have
>> it in the core considering the fact that injection points presumably
>> should be disabled in release builds.
>
> There are two more in test_aio, and by design out-of-core extensions
> can define their own.
>
>> Users will see a function in \df that does nothing.
>
> Yeah, this one's true if --enable-injection-points is not used.

The first patch of this thread introducing InjectionPointList() has
been applied as 7b2eb72b1b8c.

Now for the second part with the SRF making the injection point
information available at SQL level.  The point about adding the new
function in the core engine has been sticky, and I'm coming down to
the conclusion that I'd still want to make this stuff backpatchable if
need be in the future.  So let's just add a new function in the test
module injection_points and call it a day.

This results in the second patch attached.  Comments are welcome.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Persist injection points across server restarts
Next
From: Jacob Champion
Date:
Subject: Re: BackendKeyData is mandatory?