Re: Addition of authenticated ID to pg_stat_activity - Mailing list pgsql-hackers

From Julien Rouhaud
Subject Re: Addition of authenticated ID to pg_stat_activity
Date
Msg-id 20210427012611.kc5dqm2mdo47a3z3@nol
Whole thread Raw
In response to Re: Addition of authenticated ID to pg_stat_activity  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Addition of authenticated ID to pg_stat_activity
List pgsql-hackers
On Tue, Apr 27, 2021 at 09:59:18AM +0900, Michael Paquier wrote:
> 
> I am wondering if we should take this as an occasion to move some data
> out of pg_stat_activity into a separate biew, dedicated to the data
> related to the connection that remains set to the same value for the
> duration of a backend's life, as of the following set:
> - the backend PID

-1.  It's already annoying enough to have to type "WHERE pid !=
pg_backend_pid()" to exclude my own backend, and I usually need it quite often.
Unless we add some new view which integrate that, something like
pg_stat_activity_except_me with a better name.  I also don't see how we could
join a new dedicated view with the old one without that information.

> - application_name?  (well, this one could change on reload, so I am
> lying).

No, it can change at any time.  And the fact that it's not transactional makes
it quite convenient for poor man progress reporting.  For instance in powa I
use that to report what the bgworker is currently working on, and this has
already proven to be useful.



pgsql-hackers by date:

Previous
From: Masahiro Ikeda
Date:
Subject: Re: Transactions involving multiple postgres foreign servers, take 2
Next
From: Masahiko Sawada
Date:
Subject: Re: Performance degradation of REFRESH MATERIALIZED VIEW