Re: Why does logical replication launcher set application_name?

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Petr Jelinek <petr(dot)jelinek(at)2ndquadrant(dot)com>
Cc: Craig Ringer <craig(at)2ndquadrant(dot)com>, Kuntal Ghosh <kuntalghosh(dot)2007(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Why does logical replication launcher set application_name?
Date: 2017-04-20 19:33:42
Message-ID: d10ba0a1-b553-7b68-aa96-8105649bdf22@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 4/18/17 13:18, Tom Lane wrote:
> I think you're thinking about it wrong. To my mind the issue is that
> there should be some generic way to determine that a bgworker process
> is or is not laboring on behalf of an identifiable user. It's great
> that we can tell which user it is when there is one, but clearly some
> bgworkers will be providing general services that aren't associated with
> a single user. So it should be possible to set the userID to zero or
> some such when the bgworker is one that isn't associated with a
> particular user. Maybe the owning user needs to become an additional
> parameter passed in struct BackgroundWorker.

I think this is probably a problem particular to the logical replication
launcher. Other background workers either do work as a particular user,
as you say, or don't touch the database at all. So a localized hack or
a simple hide-the-user flag might suffice for now.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2017-04-20 19:36:14 Re: Interval for launching the table sync worker
Previous Message Peter Eisentraut 2017-04-20 19:31:03 Re: Why does logical replication launcher set application_name?