pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Pavel Luzanov <p.luzanov@postgrespro.ru>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: David G. Johnston <david.g.johnston@gmail.com>
Cc: Jonathan S. Katz <jkatz@postgresql.org>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: David Zhang <david.zhang@highgo.ca>
Cc: pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>
Cc: rmt@lists.postgresql.org
Cc: horikyota.ntt@gmail.com
Subject: Re: psql: Add role's membership options to the \du+ command
Date: Thu, 13 Jul 2023 18:59:31 +0300
Message-ID: <84651345-5f0d-50c9-ef3f-ad4ba25b9f25@postgrespro.ru> (raw)
In-Reply-To: <2879332.1689260497@sss.pgh.pa.us>
References: <b9be2d0e-a9bc-0a30-492f-a4f68e4f7740@postgrespro.ru>
	<d61db38b-29d9-81cc-55b3-8a5c704bb969@postgresql.org>
	<CAKFQuwZiomZFLd5zK=feCjY7Weefvce1MR+k38wyBMbaP2ASsg@mail.gmail.com>
	<39e7431c-1224-ab05-c67c-68f4cf625442@postgrespro.ru>
	<6b64c59a-fe41-bb07-d0cd-856896412b00@postgresql.org>
	<7aa3d663-1ea9-de0d-c13a-cbce83902214@postgrespro.ru>
	<CAKFQuwa7EDaN6wzK4TSym8KrN3oSXJmYNEDyWNGRd5qw1pyUFQ@mail.gmail.com>
	<4128935.1687478926@sss.pgh.pa.us>
	<CAKFQuwZ7RDkUMAtBE1hkcpsbEfnRQA__Rii6cW-2fipsHKF6gg@mail.gmail.com>
	<105356.1687565531@sss.pgh.pa.us>
	<CAKFQuwZxCUs=o-jWRUaHOoxBxpB1OTTVSvbz_0ivoSs4UM6KiA@mail.gmail.com>
	<b8624fab-ad13-7933-8afc-976ab106b13a@postgrespro.ru>
	<CAKFQuwad6E0C+=_uk0CFK-x1jfFNeyOOmmaMObDxC5=nyF7Gvg@mail.gmail.com>
	<41517a12-6599-b54b-d30b-3bae906a280b@postgrespro.ru>
	<a3c15b46-29c1-9fbd-88ef-b9! 66ec9c7140@postgrespro.ru>
	<1721887.1688836041@sss.p! gh.pa.us>
	<50ea2597-5e3f-372c-1ea8-5ba4f3edd690@postgrespro.ru>
	<2879332.1689260497@sss.pgh.pa.us>

On 13.07.2023 18:01, Tom Lane wrote:
> The idea with that, IMO, is to do something at least minimally sane
> if there's a bogus role OID in pg_auth_members.  With plain joins,
> the output row would disappear and you'd have no clue that anything
> is wrong.  With left joins, you get a row with a null column and
> there's reason to investigate why.
>
> Since such a case should not happen in normal use, I don't think it
> counts for discussions about compactness of output.  However, this
> is also an argument for using a plain not left join between pg_roles
> and pg_auth_members: if we do it as per the earlier patch, then
> nulls in the output are common and wouldn't draw your attention.
> (Indeed, I think broken and not-broken pg_auth_members contents
> would be indistinguishable.)

It reminds me about defensive programming practices.
That's great, thanks for explanation.

> That does not seem right.  Is it impossible for pam.set_option
> to be false?  Even if it is, should this code assume that?

For versions before 16, including one role to another automatically
gives possibility to issue SET ROLE.

IMO, the only question is whether it is correct to show IMPLICIT and
SET options in versions where they are not actually present
in pg_auth_members, but can be determined.

-- 
Pavel Luzanov
Postgres Professional: https://postgrespro.com






view thread (78+ messages)  latest in thread

Message-ID: <84651345-5f0d-50c9-ef3f-ad4ba25b9f25@postgrespro.ru>
Permalink:  ../84651345-5f0d-50c9-ef3f-ad4ba25b9f25@postgrespro.ru/
Also on:    postgresql.org/message-id/84651345-5f0d-50c9-ef3f-ad4ba25b9f25@postgrespro.ru

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: p.luzanov@postgrespro.ru, tgl@sss.pgh.pa.us, david.g.johnston@gmail.com, jkatz@postgresql.org, robertmhaas@gmail.com, david.zhang@highgo.ca, rmt@lists.postgresql.org, horikyota.ntt@gmail.com
  Subject: Re: psql: Add role's membership options to the \du+ command
  In-Reply-To: <84651345-5f0d-50c9-ef3f-ad4ba25b9f25@postgrespro.ru>
  References: <b9be2d0e-a9bc-0a30-492f-a4f68e4f7740@postgrespro.ru> <d61db38b-29d9-81cc-55b3-8a5c704bb969@postgresql.org> <CAKFQuwZiomZFLd5zK=feCjY7Weefvce1MR+k38wyBMbaP2ASsg@mail.gmail.com> <39e7431c-1224-ab05-c67c-68f4cf625442@postgrespro.ru> <6b64c59a-fe41-bb07-d0cd-856896412b00@postgresql.org> <7aa3d663-1ea9-de0d-c13a-cbce83902214@postgrespro.ru> <CAKFQuwa7EDaN6wzK4TSym8KrN3oSXJmYNEDyWNGRd5qw1pyUFQ@mail.gmail.com> <4128935.1687478926@sss.pgh.pa.us> <CAKFQuwZ7RDkUMAtBE1hkcpsbEfnRQA__Rii6cW-2fipsHKF6gg@mail.gmail.com> <105356.1687565531@sss.pgh.pa.us> <CAKFQuwZxCUs=o-jWRUaHOoxBxpB1OTTVSvbz_0ivoSs4UM6KiA@mail.gmail.com> <b8624fab-ad13-7933-8afc-976ab106b13a@postgrespro.ru> <CAKFQuwad6E0C+=_uk0CFK-x1jfFNeyOOmmaMObDxC5=nyF7Gvg@mail.gmail.com> <41517a12-6599-b54b-d30b-3bae906a280b@postgrespro.ru> <50ea2597-5e3f-372c-1ea8-5ba4f3edd690@postgrespro.ru> <2879332.1689260497@sss.pgh.pa.us> <84651345-5f0d-50c9-ef3f-ad4ba25b9f25@postgrespro.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox