Re: System username in pg_stat_activity

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Cc: Aleksander Alekseev <aleksander(at)timescale(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: System username in pg_stat_activity
Date: 2024-01-11 13:24:58
Message-ID: CABUevEx8KfR=Bj8suZQ5TMouBDJ3A+byWTBXf1=vHc6DfMgHwQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jan 10, 2024 at 3:12 PM Bertrand Drouvot
<bertranddrouvot(dot)pg(at)gmail(dot)com> wrote:
>
> Hi,
>
> On Wed, Jan 10, 2024 at 02:59:42PM +0100, Magnus Hagander wrote:
> > On Wed, Jan 10, 2024 at 2:56 PM Bertrand Drouvot
> > I definitely think it should be the same. If it's not exactly the
> > same, then it should be *two* columns, one with auth method and one
> > with the name.
> >
> > And thinking more about it maybe that's cleaner, because that makes it
> > easier to do things like filter based on auth method?
>
> Yeah, that's sounds even better.
>
> >
> > > > + <row>
> > > > + <entry role="catalog_table_entry"><para role="column_definition">
> > > > + <structfield>authname</structfield> <type>name</type>
> > > > + </para>
> > > > + <para>
> > > > + The authentication method and identity (if any) that the user
> > > > + used to log in. It contains the same value as
> > > > + <xref linkend="system-user" /> returns in the backend.
> > > > + </para></entry>
> > > > + </row>
> > >
> > > I'm fine with auth_method:identity.
> > >
> > > > + S.authname,
> > >
> > > What about using system_user as the field name? (because if we keep
> > > auth_method:identity it's not really the authname anyway).
> >
> > I was worried system_user or sysuser would both be confusing with the
> > fact that we have usesysid -- which would reference a *different*
> > sys...
>
> If we go the 2 fields way, then what about auth_identity and auth_method then?

Here is an updated patch based on this idea.

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

Attachment Content-Type Size
v3_authuser.patch text/x-patch 14.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2024-01-11 13:44:16 Re: Postgres Partitions Limitations (5.11.2.3)
Previous Message jian he 2024-01-11 13:18:15 Re: Fix log_line_prefix to display the transaction id (%x) for statements not in a transaction block