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 1pjkD4-0005OH-M7 for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Apr 2023 17:12:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pjkD2-0006zr-F0 for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Apr 2023 17:12:40 +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 1pjkD2-0006zh-5Q for pgsql-hackers@lists.postgresql.org; Tue, 04 Apr 2023 17:12:40 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pjkCz-0001yp-5D for pgsql-hackers@lists.postgresql.org; Tue, 04 Apr 2023 17:12:39 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 334HCXRZ1525118; Tue, 4 Apr 2023 13:12:33 -0400 From: Tom Lane To: Robert Haas cc: "David G. Johnston" , Pavel Luzanov , David Zhang , "pgsql-hackers@lists.postgresql.org" Subject: Re: psql: Add role's membership options to the \du+ command In-reply-to: References: <01620d6b-9efe-b199-b619-8450d865ec83@postgrespro.ru> <94ce7392-fa90-bc1c-4dc2-677161bbff58@postgrespro.ru> <20824093-d94f-e5d6-b611-8cec7fc6e95e@postgrespro.ru> <42678ca5-f3c6-db1b-e0c5-c63c3ce8997e@postgrespro.ru> <1518709.1680624790@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Tue, 04 Apr 2023 12:39:43 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1525116.1680628353.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 04 Apr 2023 13:12:33 -0400 Message-ID: <1525117.1680628353@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Robert Haas writes: > I'm not sure what the right thing to do is here. It's a problem to > have new information in the catalogs that you can't view via > \d. But displaying that information as a string of > characters that will be gibberish to anyone but an expert doesn't > necessarily seem like it really solves the problem. However, if we > spell out the words, then it gets bulky. But maybe bulky is better > than incomprehensible. The existing precedent in \du definitely leans towards "bulky": regression=3D# \du List of roles Role name | Attributes | = Member of = -----------+------------------------------------------------------------+-= ---------- alice | Cannot login | = {bob} bob | Cannot login | = {} postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | = {} It seems pretty inconsistent to me to treat the role attributes this way and then economize in the adjacent column. Another advantage to spelling out the SQL keywords is that it removes the question of whether we should translate them. I wonder if, while we're here, we should apply the idea of joining-with-newlines-not-commas to the attributes column too. That's another source of inconsistency in the proposed display. regards, tom lane