Re: System username in pg_stat_activity

From: Julien Rouhaud <rjuju123(at)gmail(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>, 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-19 12:43:05
Message-ID: CAOBaU_Yp08MQOK7_k4QVyxL6sf7TURGpjX3tn1Z+WxJo2x7+GQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Thu, Jan 18, 2024 at 11:01 PM Magnus Hagander <magnus(at)hagander(dot)net> wrote:
>
> I did. Here it is, and also including that suggested docs fix as well
> as a rebase on current master.

+ if (MyClientConnectionInfo.authn_id)
+ strlcpy(lbeentry.st_auth_identity,
MyClientConnectionInfo.authn_id, NAMEDATALEN);
+ else
+ MemSet(&lbeentry.st_auth_identity, 0,
sizeof(lbeentry.st_auth_identity));

Should we use pg_mbcliplen() here? I don't think there's any strong
guarantee that no multibyte character can be used. I also agree with
the nearby comment about MemSet being overkill.

+ value as the identity part in <xref linkend="system-user" />, or NULL
I was looking at
https://www.postgresql.org/docs/current/auth-username-maps.html and
noticed that this page is switching between system-user and
system-username. Should we clean that up while at it?

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jakub Wartak 2024-01-19 12:49:59 Re: heavily contended lwlocks with long wait queues scale badly
Previous Message torikoshia 2024-01-19 12:37:38 Re: POC PATCH: copy from ... exceptions to: (was Re: VLDB Features)