public inbox for [email protected]
help / color / mirror / Atom feedFrom: Magnus Hagander <[email protected]>
To: Bertrand Drouvot <[email protected]>
Cc: Aleksander Alekseev <[email protected]>
Cc: PostgreSQL-development <[email protected]>
Subject: Re: System username in pg_stat_activity
Date: Fri, 16 Feb 2024 20:17:41 +0100
Message-ID: <CABUevEw9kE3kB-e85fe2uv0HODrpB_mchamJLhM3pX5=m0aRcQ@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CAJ7c6TOZxbXoyh0h-Fvz9smJoV8JGrG4Wi-T6F+tVYyrVGV2nw@mail.gmail.com>
<CABUevEyZO1WnaxtChbjx4EMTtMtvNwy_ebOK1XY9YqQyDDdcfw@mail.gmail.com>
<ZZ6h/[email protected]>
<CABUevEz74kTPWKjJSBb8KxQq0518p3eDxgLBQZtJKFGZWojvyw@mail.gmail.com>
<[email protected]>
<CABUevEx8KfR=Bj8suZQ5TMouBDJ3A+byWTBXf1=vHc6DfMgHwQ@mail.gmail.com>
<[email protected]>
<CABUevEzYFpJbr_SYxh_XAX7FDiC4K1TC=dHjZydGY26V+FUsjQ@mail.gmail.com>
<[email protected]>
<CABUevEyy6==7_pm8DH1GxKyOf7oo0Gf3Tq9ey9=9991d4+dkHQ@mail.gmail.com>
<[email protected]>
On Fri, Jan 19, 2024 at 7:20 AM Bertrand Drouvot
<[email protected]> wrote:
>
> Hi,
>
> On Thu, Jan 18, 2024 at 04:01:33PM +0100, Magnus Hagander wrote:
> > On Mon, Jan 15, 2024 at 11:17 AM Bertrand Drouvot
> > > Did you forget to share the new revision (aka v4)? I can only see the
> > > "reorder_parallel_worker_bestart.patch" attached.
> >
> > I did. Here it is, and also including that suggested docs fix as well
> > as a rebase on current master.
> >
>
> Thanks!
>
> Just a few comments:
>
> 1 ===
>
> + The authentication method used for authenticating the connection, or
> + NULL for background processes.
>
> What about? "NULL for background processes (except for parallel workers which
> inherit this information from their leader process)"
Ugh. That doesn't read very well at all to me. Maybe just "NULL for
background processes without a user"?
> 2 ===
>
> + cycle before they were assigned a database role. Contains the same
> + value as the identity part in <xref linkend="system-user" />, or NULL
> + for background processes.
>
> Same comment about parallel workers.
>
> 3 ===
>
> +# pg_stat_activity should contain trust and empty string for trust auth
> +$res = $node->safe_psql(
> + 'postgres',
> + "SELECT auth_method, auth_identity='' FROM pg_stat_activity WHERE pid=pg_backend_pid()",
> + connstr => "user=scram_role");
> +is($res, 'trust|t', 'Users with trust authentication should show correctly in pg_stat_activity');
> +
> +# pg_stat_activity should contain NULL for auth of background processes
> +# (test is a bit out of place here, but this is where the other pg_stat_activity.auth* tests are)
> +$res = $node->safe_psql(
> + 'postgres',
> + "SELECT auth_method IS NULL, auth_identity IS NULL FROM pg_stat_activity WHERE backend_type='checkpointer'",
> +);
> +is($res, 't|t', 'Background processes should show NULL for auth in pg_stat_activity');
>
> What do you think about testing the parallel workers cases too? (I'm not 100%
> sure it's worth the extra complexity though).
I'm leaning towards not worth that.
--
Magnus Hagander
Me: https://www.hagander.net/
Work: https://www.redpill-linpro.com/
view thread (11+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: System username in pg_stat_activity
In-Reply-To: <CABUevEw9kE3kB-e85fe2uv0HODrpB_mchamJLhM3pX5=m0aRcQ@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox