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 13515.1511147468@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] [PATCH] A hook for session start  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: [HACKERS] [PATCH] A hook for session start  (Michael Paquier <michael.paquier@gmail.com>)
List 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 by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [HACKERS] Support for Secure Transport SSL library on macOS asOpenSSL alternative
Next
From: Michael Paquier
Date:
Subject: Re: [HACKERS] [PATCH] A hook for session start