Re: Hooks for session start and end, take two - Mailing list pgsql-hackers

From Fabrízio de Royes Mello
Subject Re: Hooks for session start and end, take two
Date
Msg-id CAFcNs+qt6n7j-Qbes7Na_nwyytLkp91cK-jV=bo8EYsdnh9cug@mail.gmail.com
Whole thread Raw
In response to Re: Hooks for session start and end, take two  (legrand legrand <legrand_legrand@hotmail.com>)
Responses Re: Hooks for session start and end, take two
List pgsql-hackers
On Fri, Sep 27, 2019 at 4:26 PM legrand legrand <legrand_legrand@hotmail.com> wrote:
>
> OK I confirm:
> - "client backend" appears at session start and end hook,
> - "autovacuum worker" and "pg_background" only appears at session end hook
>   (backend_start can be retreived from pg_stat_activity),
> - "parallel workers" are not visible at all
>   (because extension cannot assign XIDs during a parallel operation)
>
> All seems fine to me.
>

Hi all,

First of all thanks Michael for bringing this to life again.

I poked a little with the patch and everything is ok. Your check for normal backend on test_session_hooks is much simpler than I did before:

+    /* just consider normal backends */
+    if (MyBackendId == InvalidBackendId)
+        return;

But one thing came to my mind, why not in this first version we hook just normal backends? 

Regards,

--
   Fabrízio de Royes Mello         Timbira - http://www.timbira.com.br/
   PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento

pgsql-hackers by date:

Previous
From: Antonin Houska
Date:
Subject: Re: Attempt to consolidate reading of XLOG page
Next
From: Fujii Masao
Date:
Subject: Re: Standby accepts recovery_target_timeline setting?