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

From Kirill Reshke
Subject Re: Add pg_get_injection_points() for information of injection points
Date
Msg-id CALdSSPh7jxiM0LOzBkEgB4xVqRXoM0DE8ac58kMOBPm+qijdvA@mail.gmail.com
Whole thread Raw
In response to 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 Mon, 14 Apr 2025 at 05:36, Michael Paquier <michael@paquier.xyz> wrote:
>
> Hi all,
>
> One thing that's been lacking in injection points is the possibility
> to look at the state of the injection points in shared memory through
> some SQL.  This was on my tablets for some time, but I have not taken
> the time to do the actual legwork.
>
> The attached patch adds a SRF that returns a set of tuples made of the
> name, library and function for all the injection points attached to
> the system.  This implementation relies on a new function added in
> injection_point.c, called InjectionPointList(), that retrieves a
> palloc()'d array of the injection points, hiding from the callers the
> internals of what this stuff does with the shmem array lookup.
>
> This is useful for monitoring or in tests, to make sure for example
> that nothing is left around at the end of a script.  I have a
> different proposal planned for this area of the code, where this
> function would be good to have, but I am sending an independent patch
> as this stuff is useful on its own.
>
> The patch includes a couple of tests and some documentation.
>
> Thanks,
> --
> Michael

Hi! I noticed you do not bump catalog version here, so i was a little
confused with
```
reshke=# SELECT name, library, function FROM pg_get_injection_points();
ERROR:  function pg_get_injection_points() does not exist
```
for a while

Also, should we define pg_get_injection_points in the injection_points
extension maybe?

-- 
Best regards,
Kirill Reshke



pgsql-hackers by date:

Previous
From: Matheus Alcantara
Date:
Subject: Re: New committer: Jacob Champion
Next
From: Michael Paquier
Date:
Subject: Re: Add pg_get_injection_points() for information of injection points