Re: System username in pg_stat_activity - Mailing list pgsql-hackers

From Magnus Hagander
Subject Re: System username in pg_stat_activity
Date
Msg-id CABUevEw_7pSw38ya1RagWBs85H4n8MGH-k-FTstRGnayQyA4Kg@mail.gmail.com
Whole thread Raw
In response to Re: System username in pg_stat_activity  (Andres Freund <andres@anarazel.de>)
Responses Re: System username in pg_stat_activity
Re: System username in pg_stat_activity
List pgsql-hackers
On Fri, Feb 16, 2024 at 8:41 PM Andres Freund <andres@anarazel.de> wrote:
>
> Hi,
>
> On 2024-01-10 12:46:34 +0100, Magnus Hagander wrote:
> > The attached patch adds a column "authuser" to pg_stat_activity which
> > contains the username of the externally authenticated user, being the
> > same value as the SYSTEM_USER keyword returns in a backend.
>
> I continue to think that it's a bad idea to make pg_stat_activity ever wider
> with columns that do not actually describe properties that change across the
> course of a session.  Yes, there's the argument that that ship has sailed, but
> I don't think that's a good reason to continue ever further down that road.
>
> It's not just a usability issue, it also makes it more expensive to query
> pg_stat_activity. This is of course more pronounced with textual columns than
> with integer ones.

That's a fair point, but I do think that has in most ways already sailed, yes.

I mean, we could split it into more than one view. But adding a new
view for every new thing we want to show is also not very good from
either a usability or performance perspective.  So where would we put
it?

--
 Magnus Hagander
 Me: https://www.hagander.net/
 Work: https://www.redpill-linpro.com/



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: System username in pg_stat_activity
Next
From: Nathan Bossart
Date:
Subject: Re: glibc qsort() vulnerability