Re: bgw_type (was Re: Why does logical replication launcher set application_name?)

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: bgw_type (was Re: Why does logical replication launcher set application_name?)
Date: 2017-09-01 03:22:37
Message-ID: CAB7nPqSkeN-6BJYX-=6JAo4bK_w_+jzZ1p5=T0C-ZRPNnrdbmA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Sep 1, 2017 at 4:49 AM, Peter Eisentraut
<peter(dot)eisentraut(at)2ndquadrant(dot)com> wrote:
> On 5/30/17 23:10, Peter Eisentraut 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.
>
> Updated patch incorporating the feedback. I have kept bgw_name as it
> was and just added bgw_type completely independently.

- errmsg("terminating background worker \"%s\" due to
administrator command",
- MyBgworkerEntry->bgw_name)));
+ errmsg("terminating %s due to administrator command",
+ MyBgworkerEntry->bgw_type)));
"terminating background worker %s of type %s due to administrator
command", bgw_name, bgw_type?

> One open question is how to treat a missing (empty) bgw_type. I
> currently fill in bgw_name as a fallback. We could also treat it as an
> error or a warning as a transition measure.

Hm. Why not reporting an empty type string as NULL at SQL level and
just let it empty them? I tend to like more interfaces that report
exactly what is exactly registered at memory-level, because that's
easier to explain to users and in the documentation, as well as easier
to interpret and easier for module developers.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2017-09-01 03:33:04 Upcoming commit fest will begin soon
Previous Message Tom Lane 2017-09-01 03:07:09 Re: Hash Functions