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

2017-11-27 Thread Michael Paquier
On Tue, Nov 21, 2017 at 4:09 AM, Fabrízio de Royes Mello wrote: > Due to some "Blackfriday" commitments I'll be able to work again with this > patch on next week. Okay, this has proved to require broader changes than thought first. I am marking the patch as returned with

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

2017-11-20 Thread Fabrízio de Royes Mello
On Mon, Nov 20, 2017 at 2:56 PM, Tom Lane wrote: > > =?UTF-8?Q?Fabr=C3=ADzio_de_Royes_Mello?= writes: > > typedef enum > > { > > ClientBackendProcess = -1, > > CheckerProcess = 0, > > BootstrapProcess, > > Uh, why would you do that (start

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

2017-11-20 Thread Tom Lane
=?UTF-8?Q?Fabr=C3=ADzio_de_Royes_Mello?= writes: > typedef enum > { > ClientBackendProcess = -1, > CheckerProcess = 0, > BootstrapProcess, Uh, why would you do that (start from -1)? It makes it impossible to build an array indexed by the enum, which might be

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

2017-11-19 Thread Tom Lane
Michael Paquier writes: > On Mon, Nov 20, 2017 at 12:11 PM, Tom Lane wrote: >> 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,

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

2017-11-19 Thread Michael Paquier
On Mon, Nov 20, 2017 at 12:11 PM, Tom Lane wrote: > 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

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

2017-11-19 Thread Tom Lane
Michael Paquier 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

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

2017-11-19 Thread Andrew Dunstan
On 11/19/2017 04:49 PM, Tom Lane wrote: > Andrew Dunstan writes: >> I think this: >> #define IsClientBackend() \ >>     (MyBackendId != InvalidBackendId &&    \ >> !IsAutoVacuumLauncherProcess() &&    \ >> !IsAutoVacuumWorkerProcess() &&

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

2017-11-19 Thread Tom Lane
Andrew Dunstan writes: > I think this: > #define IsClientBackend() \ >     (MyBackendId != InvalidBackendId &&    \ > !IsAutoVacuumLauncherProcess() &&    \ > !IsAutoVacuumWorkerProcess() && \ > !am_walsender && \ >

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

2017-11-19 Thread Andrew Dunstan
On 11/16/2017 10:38 PM, Fabrízio de Royes Mello wrote: > Hi all, > > Attached new version of the patch fixing issues about installcheck and > some assertions reported before (based on Michael Paquier code): > >

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

2017-11-17 Thread Fabrízio de Royes Mello
On Fri, Nov 17, 2017 at 3:33 AM, Ashutosh Sharma wrote: > > On Fri, Nov 17, 2017 at 9:08 AM, Fabrízio de Royes Mello > wrote: > > Hi all, > > > > Attached new version of the patch fixing issues about installcheck and some > > assertions reported

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

2017-11-16 Thread Ashutosh Sharma
On Fri, Nov 17, 2017 at 9:08 AM, Fabrízio de Royes Mello wrote: > Hi all, > > Attached new version of the patch fixing issues about installcheck and some > assertions reported before (based on Michael Paquier code): > The assertion failure which i reported earlier -[1]