Re: [HACKERS] [PATCH] A hook for session start

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>
Cc: fabriziomello(at)gmail(dot)com, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Aleksandr Parfenov <a(dot)parfenov(at)postgrespro(dot)ru>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>, Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>, Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>
Subject: Re: [HACKERS] [PATCH] A hook for session start
Date: 2017-11-19 21:49:49
Message-ID: 31093.1511128189@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2017-11-19 22:33:14 Re: [HACKERS] INSERT ON CONFLICT and partitioned tables
Previous Message Andrew Dunstan 2017-11-19 21:38:47 Re: [HACKERS] [PATCH] A hook for session start