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 feedback. -- Michael

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 from -1)? It makes it impossible to > build a

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 useful --- converting enu

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

2017-11-20 Thread Fabrízio de Royes Mello
On Mon, Nov 20, 2017 at 1:38 AM, Tom Lane wrote: > > 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

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, "utils/proctype.h" or so. > I am on board for a new, d

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 miscadmin.h, so one possibil

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 all the business of pgstat_bes

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

2017-11-19 Thread Michael Paquier
On Mon, Nov 20, 2017 at 7:56 AM, Andrew Dunstan wrote: > On 11/19/2017 04:49 PM, Tom Lane wrote: >> Andrew Dunstan writes: >>> I think this: >>> #define IsClientBackend() \ >>> (MyBackendId != InvalidBackendId &&\ >>> !IsAutoVacuumLauncherProcess() &&\ >>> !I

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() && \ >> !am_walsender && \

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 && \ > !IsBackgroundWorker) > probably belo

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): > > https://www.postgresql.org/message-id/flat/30479.1510800078%40sss.pgh.pa.us#30479.1510

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 before (based on Michael Paquier code): > > > > The

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] is fixed with v11 patch. FY

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

2017-11-16 Thread Fabrízio de Royes Mello
Hi all, Attached new version of the patch fixing issues about installcheck and some assertions reported before (based on Michael Paquier code): https://www.postgresql.org/message-id/flat/30479.1510800078%40sss.pgh.pa.us#30479.1510800...@sss.pgh.pa.us https://www.postgresql.org/message-id/flat/201