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

From legrand legrand
Subject Re: Hooks for session start and end, take two
Date
Msg-id 1569612391664-0.post@n3.nabble.com
Whole thread Raw
In response to Re: Hooks for session start and end, take two  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Hooks for session start and end, take two
List pgsql-hackers
Michael Paquier-2 wrote
> On Thu, Sep 26, 2019 at 09:57:57AM -0700, legrand legrand wrote:
>> Does that mean that all processes seen in pg_stat_activity like
>> - autovacuum launcher
>> - logical replication launcher
>> - background writer
>> - checkpointer
>> - walwriter
>> ... 
>> - Parallel worker
>> are available with that hook (it seems not) ?
> 
> All processes using PostgresMain() for their startup take this code
> path like WAL senders and normal backend sessions, but not things
> going through StartChildProcess() (WAL receiver, bgwriter, etc.) or
> other processes like autovacuum processes which use a different start
> code path.

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.

Regards
PAscal






--
Sent from: https://www.postgresql-archive.org/PostgreSQL-hackers-f1928748.html



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Improving on MAX_CONVERSION_GROWTH
Next
From: Tom Lane
Date:
Subject: Re: Attempt to consolidate reading of XLOG page