Re: Extend injection_points_attach() to accept a user-defined function
| От | Michael Paquier | 
|---|---|
| Тема | Re: Extend injection_points_attach() to accept a user-defined function | 
| Дата | |
| Msg-id | aQDGFZCnYMTaEEuH@paquier.xyz обсуждение исходный текст  | 
		
| Ответ на | Extend injection_points_attach() to accept a user-defined function (Rahila Syed <rahilasyed90@gmail.com>) | 
| Ответы | 
                	
            		Re: Extend injection_points_attach() to accept a user-defined function
            		
            		 | 
		
| Список | pgsql-hackers | 
On Tue, Oct 28, 2025 at 06:11:25PM +0530, Rahila Syed wrote:
> I would like to propose providing a sql interface to link a
> user-defined function to an injection point.
> Currently, if a user wants an injection point to invoke a custom
> function, they must first define an SQL
> function that attaches the injection point to the target/custom
> function. This SQL function can then be called
> in sql tests to attach to the injection point before running the tests.
> The attached patch simplifies this by extending the
> injection_points_attach() function to support a new
> action type called "func".
@@ -354,6 +354,7 @@ injection_points_attach(PG_FUNCTION_ARGS)
+    char       *mod_name;
[...]
@@ -362,6 +363,15 @@ injection_points_attach(PG_FUNCTION_ARGS)
         function = "injection_notice";
     else if (strcmp(action, "wait") == 0)
         function = "injection_wait";
+    else if (strcmp(action, "func") == 0)
How about a simpler injection_points_attach(point_name text, func
text, module text) with a second SQL function, but a different number
of arguments?   Using a new hardcoded action for this purpose is
confusing as your point is to introduce a SQL wrapper on top of
InjectionPointAttach(), and using input arguments that match with the
C function is an attractive option.
--
Michael
		
	Вложения
В списке pgsql-hackers по дате отправления: