Re: [HACKERS] [PATCH] A hook for session start
От | Andrew Dunstan |
---|---|
Тема | Re: [HACKERS] [PATCH] A hook for session start |
Дата | |
Msg-id | 0008cccc-fe56-6306-b7ce-b3c533757e21@2ndQuadrant.com обсуждение исходный текст |
Ответ на | Re: [HACKERS] [PATCH] A hook for session start (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: [HACKERS] [PATCH] A hook for session start
|
Список | pgsql-hackers |
On 11/19/2017 04:49 PM, Tom Lane wrote: > Andrew Dunstan <andrew.dunstan@2ndquadrant.com> writes: >> I think this: >> #define IsClientBackend() \ >> (MyBackendId != InvalidBackendId && \ >> !IsAutoVacuumLauncherProcess() && \ >> !IsAutoVacuumWorkerProcess() && \ >> !am_walsender && \ >> !IsBackgroundWorker) >> probably belongs somewhere more central. Surely this isn't the only >> place that we want to be able to run such a test? > Hm. It also seems awfully awkward. Perhaps it's not being used anyplace > performance-critical, but regardless of speed it seems like a modularity > violation, in that client backends have to be explicitly aware of > everything that isn't a "client backend". > > Maybe it's time to invent something corresponding to AuxProcType > for non "aux" processes, or else to fold all types of Postgres > processes into the same enum. Yes, agreed, The above is pretty ugly and likely to be quite fragile. cheers andrew -- Andrew Dunstan https://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
В списке pgsql-hackers по дате отправления: