Re: [HACKERS] [PATCH] A hook for session start
От | Tom Lane |
---|---|
Тема | Re: [HACKERS] [PATCH] A hook for session start |
Дата | |
Msg-id | 13515.1511147468@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: [HACKERS] [PATCH] A hook for session start (Michael Paquier <michael.paquier@gmail.com>) |
Ответы |
Re: [HACKERS] [PATCH] A hook for session start
|
Список | pgsql-hackers |
Michael Paquier <michael.paquier@gmail.com> writes: > I was the one suggesting to Fabrizio to look at how backend types are > evaluated in pgstat.c after an off-list discussion. Agreed that this > result is fragile as this makes two places dependent on the process > types. Why not simply moving all the business of pgstat_bestart() > evaluating which st_backendType to use into a common routine and have > pgstat.c and have this utility use this API? pgstat.h already includes > BackendType as an enum to use so this could live with a routine > available in pgstat.c. Or would it be cleaner to have a new thing > dedicated to process-related information, say as > src/backend/utils/misc/process_info.c? It is indeed strange to have a > session-related feature depend on something with statistics. This is really about consolidating a whole bunch of ad-hoc stuff. I don't think pgstat has any particular pride of place here. It should be one consumer of a common API. The stuff related to AuxProcType is in miscadmin.h, so one possibility is to put the new enum there. But I could see inventing a whole new header for this, "utils/proctype.h" or so. regards, tom lane
В списке pgsql-hackers по дате отправления: