RE: Add pg_get_injection_points() for information of injection points

Поиск
Список
Период
Сортировка
От Hayato Kuroda (Fujitsu)
Тема RE: Add pg_get_injection_points() for information of injection points
Дата
Msg-id OSCPR01MB149664969EE88A9F2E3FC9F8AF5B32@OSCPR01MB14966.jpnprd01.prod.outlook.com
обсуждение исходный текст
Ответ на Add pg_get_injection_points() for information of injection points  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: Add pg_get_injection_points() for information of injection points
Список pgsql-hackers
Dear Michael,

Thanks for creating the patch! Let me confirm two points:

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?

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?


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.

[1]:
```
SELECT injection_points_attach('TestInjectionLog', 'notice');
 injection_points_attach
-------------------------

(1 row)

SELECT injection_points_attach('TestInjectionError', 'error');
 injection_points_attach
-------------------------

(1 row)

SELECT injection_points_detach('TestInjectionLog');
 injection_points_detach
-------------------------

(1 row)

SELECT name, library, function FROM pg_get_injection_points()
  ORDER BY name COLLATE "C";
server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
connection to server was lost
```

Best regards,
Hayato Kuroda
FUJITSU LIMITED


Вложения

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