Thread

  1. Re: Extend injection_points_attach() to accept a user-defined function

    Rahila Syed <rahilasyed90@gmail.com> — 2025-11-04T08:47:44Z

    Hi Mihail,
    
    Thank you for looking into this thread.
    
    >
    > I thought it may help me to implement some kind of notice+wait
    > required for [1] in order to stabilize the tests.
    >
    > Is it possible to do something like this in the attached function?
    >
    >     RAISE NOTICE 'going to wait';
    >     SELECT injection_points_run(some_point_with_wait"); -- wait called
    > inside injection point handler
    >
    
    One way to achieve this using the proposed SQL function is to create a
    C function in a module like injection_points, which combines injection_notice
    and injection_wait. You can then pass this combined function as an argument
    to the proposed injection_points_attach() function.
    
    Something as follows:
    
    SELECT injection_points_attach('TestInjectionNoticeFunc',
    'injection_points', 'injection_notice_and_wait');
    
    > Also, I think it is a good idea to add some tests to injection_points.sql.
    >
    
    PFA a rebased patch that contains the test.
    The tests use the newly added SQL function to attach the injection_notice
    function to an injection point
    
    
    Thank you,
    Rahila Syed