Re: expose parallel leader in CSV and log_line_prefix

Alvaro Herrera <alvherre@2ndquadrant.com>

From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Justin Pryzby <pryzby@telsasoft.com>, Julien Rouhaud <rjuju123@gmail.com>, Tomas Vondra <tomas.vondra@2ndquadrant.com>, pgsql-hackers@postgresql.org
Date: 2020-07-22T15:36:05Z
Lists: pgsql-hackers
On 2020-Jul-21, Michael Paquier wrote:

> On Mon, Jul 20, 2020 at 11:12:31PM -0500, Justin Pryzby wrote:

> >> +       Process ID of the parallel group leader if this process is involved
> >> +       in parallel query, or null.  For a parallel group leader, this field
> >> +       is <literal>NULL</literal>.
> >>        </para></entry>

> > | For a parallel worker, this is the Process ID of its leader process.  Null
> > | for processes which are not parallel workers.

How about we combine both.  "Process ID of the parallel group leader, if
this process is a parallel query worker.  NULL if this process is a
parallel group leader or does not participate in parallel query".

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



Commits

  1. Add %P to log_line_prefix for parallel group leader

  2. Tweak behavior of pg_stat_activity.leader_pid

  3. Add leader_pid to pg_stat_activity