Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q9s19-0002Fl-Sq for pgsql-hackers@arkaria.postgresql.org; Thu, 15 Jun 2023 18:48:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q9s16-0006Wf-FY for pgsql-hackers@arkaria.postgresql.org; Thu, 15 Jun 2023 18:48:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q9s16-0006WO-2J; Thu, 15 Jun 2023 18:48:20 +0000 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1q9s11-002OYO-Un; Thu, 15 Jun 2023 18:48:18 +0000 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-98276e2a4bbso300428766b.0; Thu, 15 Jun 2023 11:48:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686854892; x=1689446892; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=CzrhSjggk8fZKio3hfsADy+80pdcnWcqkZicpv+Eeq8=; b=lKiky3T57jwF9Gq/OqNuADXA/DAONNqzpETlat0So1a/8+X+giN8bTyg9FR17gvDJV KzuRdwg2voeMlrGes6l8Zm5Bg+NA8hVZtqN6V9+ttCGAEv9Ft1XgYx7QBIl7OAD5S3fA vzybjzF5tSrWS8aYu9jZegVzK//GMPubr3A1gZ8qk+kGpEARBaa82HE8xn9ZpCjYtUVA 9W15eV4Sjgh87KPcW1KJuPjzUeSQz6YydXsQnAIn6nLkpUZm47DZ/b/Sv3zHD06PK1CN d4IjfO2ZGf3Q/RM6ein2eUdGswP6v16CBfaHzum9+f707nrYDOGCJxFWKqqe2El6QVJR BB2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686854892; x=1689446892; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=CzrhSjggk8fZKio3hfsADy+80pdcnWcqkZicpv+Eeq8=; b=cMJV8DZ6cQiXBgDfbW05j7Mtyx8ghBhG01Urt5UbAUEPlWorzSynWhXjHzJB5SeshD 636UGJ8GfwTNb0RIUCWOYaozE92YxCQV+T3vzT9BSV4c7cXoB/KdDeZQhgUTQ+WPUzZS 0So0G2nAyEH5tGR9vs8bQ7MbjBurIaJ7T/2reBdrZkRy0TQhj/ZDBnJAdWzapePpliN3 L/YbFifuozsupQ1cNK+5cBzhYYyofJOSJvV0LQH2O2bVNSZijEd1/hfGckll9VHqwQ8N ihqyzyxmDrdsrlYrItZiSMVX4W+IYHN7Bshs7HSDcB4ubpoSdQTEmMRnqV3GG53tWWSz 8i6w== X-Gm-Message-State: AC+VfDyw90YNim1jxajVTFyfYP6ogVLh0VJEk77LSO+uRHE3RTUh/2F6 pIDyh0WOkkT0pFaTAgJjvUJVMjefmfhSPCA/ztelNAOcbEY= X-Google-Smtp-Source: ACHHUZ7o2TDhAdIRJo+w4Foq0OkbFtc2IouABYxbweHqSg23BMA8I1BLKDaMwIAKAyOkTKZBJr4NEv99LLNeJ6VO8lw= X-Received: by 2002:a17:907:2682:b0:978:6634:d05c with SMTP id bn2-20020a170907268200b009786634d05cmr20537936ejc.21.1686854892080; Thu, 15 Jun 2023 11:48:12 -0700 (PDT) MIME-Version: 1.0 References: <1525117.1680628353@sss.pgh.pa.us> <1575395.1680629866@sss.pgh.pa.us> <1831161.1680703111@sss.pgh.pa.us> <2977612.1683131109@sss.pgh.pa.us> <39e7431c-1224-ab05-c67c-68f4cf625442@postgrespro.ru> <6b64c59a-fe41-bb07-d0cd-856896412b00@postgresql.org> <7aa3d663-1ea9-de0d-c13a-cbce83902214@postgrespro.ru> In-Reply-To: <7aa3d663-1ea9-de0d-c13a-cbce83902214@postgrespro.ru> From: "David G. Johnston" Date: Thu, 15 Jun 2023 11:47:56 -0700 Message-ID: Subject: Re: psql: Add role's membership options to the \du+ command To: Pavel Luzanov Cc: "Jonathan S. Katz" , Tom Lane , Robert Haas , David Zhang , "pgsql-hackers@lists.postgresql.org" , rmt@lists.postgresql.org, horikyota.ntt@gmail.com Content-Type: multipart/alternative; boundary="000000000000a1514e05fe2f8230" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000a1514e05fe2f8230 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Robert - can you please comment on what you are willing to commit in order to close out your open item here. My take is that the design for this, the tabular form a couple of emails ago (copied here), is ready-to-commit, just needing the actual (trivial) code changes to be made to accomplish it. Tabular form rolname | memberof | options | grantor ------------------+------------------+---------------------+--= ---------------- postgres | | | regress_du_admin | regress_du_role0+| admin, inherit, set+| postgres + | regress_du_role1+| admin, inherit, set+| postgres + | regress_du_role2 | admin, inherit, set | postgres regress_du_role0 | | | regress_du_role1 | regress_du_role0+| admin, inherit, set+| regress_du_admin+ | regress_du_role0+| inherit +| regress_du_role1+ | regress_du_role0 | set | regress_du_role2 regress_du_role2 | regress_du_role0+| admin +| regress_du_admin+ | regress_du_role0+| inherit, set +| regress_du_role1+ | regress_du_role0+| empty +| regress_du_role2+ | regress_du_role1 | admin, set | regress_du_admin(5 rows) On Thu, May 18, 2023 at 6:07=E2=80=AFAM Pavel Luzanov wrote: > On 18.05.2023 05:42, Jonathan S. Katz wrote: > > That said, from a readability standpoint, it was easier for me to follow > the tabular form vs. the sentence form. > > May be possible to reach a agreement on the sentence form. Similar descri= ptions used > for referential constraints in the \d command: > > I think we should consider the tabular form with translatable headers to be the acceptable choice here. I don't see enough value in the sentence form to make it worth trying to overcome the i18n objection there. > As for tabular form it looks more natural to have a separate psql command > for pg_auth_members system catalog. Something based on this query:But is = it worth inventing a new psql command for this? > > IMO, no. I'd much rather read "admin, inherit, set" than deal with true/false in columns. I think the newlines are better compared to repetition of the rolname as well. I'm also strongly in favor of explicitly writing out the word "empty" instead of leaving the column blank for the case that no options are marked true. But it isn't a show-stopper for me. David J. --000000000000a1514e05fe2f8230 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Robert - can you please comment on what you are willing to= commit in order to close out your open item here.=C2=A0 My take is that th= e design for this, the tabular form a couple of emails ago (copied here), i= s ready-to-commit, just needing the actual (trivial) code changes to be mad= e to accomplish it.

Tabular form
=C2=A0=C2=A0=C2=A0=C2=A0 rolname=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0 memberof=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 options=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 |=C2=A0=C2=A0=C2=A0=C2=A0 grantor=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0
------------------+------------------+---------------------+------=
------------
=C2=A0postgres=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 | 
=C2=A0regress_du_admin | regress_du_role0+| admin, inherit, set+| =
postgres=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 +
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | regress_du_role1+| admin, inherit, s=
et+| postgres=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 +
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | regress_du_role2 | admin, inherit, s=
et | postgres
=C2=A0regress_du_role0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 
=C2=A0regress_du_role1 | regress_du_role0+| admin, inherit, set+| =
regress_du_admin+
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | regress_du_role0+| inherit=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 +| regress_du_rol=
e1+
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | regress_du_role0 | set=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 | regress_du_role2
=C2=A0regress_du_role2 | regress_du_role0+| admin=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 +| regress_=
du_admin+
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | regress_du_role0+| inherit, set=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 +| regress_du_role1+
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | regress_du_role0+| empty=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 +| regre=
ss_du_role2+
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | regress_du_role1 | admin, set=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | regress_du_admin
(5 rows)

On Thu,= May 18, 2023 at 6:07=E2=80=AFAM Pavel Luzanov <p.luzanov@postgrespro.ru> wrote:
=20 =20 =20
On 18.05.2023 05:42, Jonathan S. Katz wrote:
That said, from a readability standpoint, it was easier for =
me to follow=20
the tabular form vs. the sentence form.
May be possible to reach a agreement on the sentence form=
. Similar descriptions used
for referential constraints in the \d command:
I think we should consider the tabular form with translatabl= e headers to be the acceptable choice here.=C2=A0 I don't see enough va= lue in the sentence form to make it worth trying to overcome the i18n objec= tion there.

As for tabular form it looks more natural to have a separate psql =
command
for pg_auth_members system catalog. Something based on this query:

But is it worth inventing a new psql command for this?
<= /div>

IMO, no.=C2=A0 I'd much rather read= "admin, inherit, set" than deal with true/false in columns.=C2= =A0 I think the newlines are better compared to repetition of the rolname a= s well.

I'm also strongly in favor of explicitly w= riting out the word "empty" instead of leaving the column blank f= or the case that no options are marked true.=C2=A0 But it isn't a show-= stopper for me.

David J.

--000000000000a1514e05fe2f8230--