Re: [HACKERS] [PATCH] A hook for session start - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] [PATCH] A hook for session start
Date
Msg-id 31093.1511128189@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] [PATCH] A hook for session start  (Andrew Dunstan <andrew.dunstan@2ndquadrant.com>)
Responses Re: [HACKERS] [PATCH] A hook for session start  (Andrew Dunstan <andrew.dunstan@2ndquadrant.com>)
List pgsql-hackers
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.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: [HACKERS] [PATCH] A hook for session start
Next
From: Simon Riggs
Date:
Subject: Re: [HACKERS] INSERT ON CONFLICT and partitioned tables