Re: expose parallel leader in CSV and log_line_prefix

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>, Julien Rouhaud <rjuju123@gmail.com>, Tomas Vondra <tomas.vondra@2ndquadrant.com>, pgsql-hackers@postgresql.org
Date: 2020-08-03T04:41:52Z
Lists: pgsql-hackers
On Fri, Jul 31, 2020 at 10:31:13PM -0500, Justin Pryzby wrote:
> Also, I was reminded by Tom's c410af098 about this comment:
> 
>                  * Further note: At least on some platforms, passing %*s rather than
>                  * %s to appendStringInfo() is substantially slower, so many of the
>                  * cases below avoid doing that unless non-zero padding is in fact
>                  * specified.
> 
> It seems we can remove that hack and avoid its spiriling conditionals.
> It's cleaner to make that 0001.

Not sure what 0001 is doing on this thread, so I would suggest to
create a new thread for that to attract the correct audience.  It is
true that we should not need that anymore as we use our own
implementation of sprintf now.

For now, I have taken 0002 as a base, fixed a couple of things (doc
tweaks, removed unnecessary header inclusion, etc.), and committed it,
meaning that we are done here.
--
Michael

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