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

Поиск
Список
Период
Сортировка
От Rahila Syed
Тема Re: Extend injection_points_attach() to accept a user-defined function
Дата
Msg-id CAH2L28ukX+MbBQDZXMVpRZHyjm6R-L3Y5-oMzZXxox2VTwcWzg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Extend injection_points_attach() to accept a user-defined function  (Mihail Nikalayeu <mihailnikalayeu@gmail.com>)
Список pgsql-hackers
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

Вложения

В списке pgsql-hackers по дате отправления: