Re: Add pg_get_injection_points() for information of injection points
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-04-14T23:40:04Z
Lists: pgsql-hackers
Attachments
- v2-0001-Add-pg_get_injection_points.patch (text/x-diff) patch v2-0001
On Mon, Apr 14, 2025 at 06:15:07AM +0000, Hayato Kuroda (Fujitsu) wrote: > Apart from functions related with injection_points, this can be called even when > postgres has been built with -Dinjection_points=false. This is intentional because > this function does not have any side-effect and just refers the status. Is my > understanding correct? Yes. The function could be changed to return an ERROR if the build does not support this option. It's more portable to return NULL if you have some queries that do joins. This could be used with pg_stat_activity and wait events for example, and some points are in positions strategic enough that they could be used across more than one library, like the restart point one or the autovacuum startup one. > I'm not sure it is directly related, but ISTM there are no direct ways to check > whether the injection_points is enabled or not. How do you think adding the > function? Yeah, we could use something like that, not sure if that's worth it. > Regarding the internal of the patch, it could be crashed when two points are > attached and then first one is detached [1]. I think we should not use "idx" for > the result array - PSA the fix. Oops. That's a brain fart from my side. Thanks. -- Michael
Commits
-
injection_points: Add injection_points_list()
- 4eca711bc991 19 (unreleased) landed
-
Add InjectionPointList() to retrieve list of injection points
- 7b2eb72b1b8c 19 (unreleased) landed