On 6/2/17 02:31, Masahiko Sawada wrote:
> On Wed, May 31, 2017 at 12:10 PM, Peter Eisentraut
> <peter.eisentraut@2ndquadrant.com> wrote:
>> Here is a proposed solution that splits bgw_name into bgw_type and
>> bgw_name_extra. bgw_type shows up in pg_stat_activity.backend_type.
>> Uses of application_name are removed, because they are no longer
>> necessary to identity the process type.
>
> Hmm, is there any reasons why bgw_name_extra string doesn't appear in
> pg_stat_activity?
That's the whole point: We want to be able to group similar process
types. The _extra part is particular to a single process, so it might
contain a specific OID or PID it is working on. The bgw_type is common
for all workers of that kind.
> I'd say current patch makes the user difficult to
> distinguish between apply worker and table sync worker.
We could arguably make apply workers and sync workers have different
bgw_type values. But if you are interested in that level of detail, you
should perhaps look at pg_stat_subscription. pg_stat_activity only
contains the "common" data, and the process-specific data is in other views.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services