public inbox for [email protected]
help / color / mirror / Atom feedFrom: Pavel Luzanov <[email protected]>
To: Jonathan S. Katz <[email protected]>
To: David G. Johnston <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: Robert Haas <[email protected]>
Cc: David Zhang <[email protected]>
Cc: [email protected] <[email protected]>
Cc: [email protected]
Cc: [email protected]
Subject: Re: psql: Add role's membership options to the \du+ command
Date: Thu, 18 May 2023 16:07:22 +0300
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
<[email protected]>
<CA+TgmoatW6D_iyyCqbKcjS6MQt-fBTWzmynruk+x1B8oz22kog@mail.gmail.com>
<[email protected]>
<CA+TgmoZgj+zJ4C3To0f5=_M+ZJT2Yxa0pO_31Kr7KBhf8wXr6w@mail.gmail.com>
<[email protected]>
<CAKFQuwY0CqZdZL3Wq6kM7WEQX+RfFYeNY6_ON_SCJ1vRRbrO=g@mail.gmail.com>
<[email protected]>
<[email protected]>
<CAKFQuwanYpV_0quPhRMpVoyUew4-4to0u1E0uXMNY4=ODPZHWQ@mail.gmail.com>
<[email protected]>
<CAKFQuwZXQP7ox0jsa+AqKa-4MkTpd2VypJm9dkXsk+6wKEQ2Gg@mail.gmail.com>
<[email protected]>
<[email protected]>
<CAKFQuwZiomZFLd5zK=feCjY7Weefvce1MR+k38wyBMbaP2ASsg@mail.gmail.com>
<[email protected]>
<[email protected]>
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
descriptions used for referential constraints in the \d command:
create table t1 (id int primary key);create table t2 (id int references
t1(id));\d t2 Table "public.t2" Column | Type |
Collation | Nullable | Default
--------+---------+-----------+----------+--------- id | integer
| | | Foreign-key constraints: "t2_id_fkey"
FOREIGN KEY (id) REFERENCES t1(id)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:SELECT r.rolname role, m.rolname
member, admin_option admin, inherit_option inherit, set_option
set, g.rolname grantorFROM pg_catalog.pg_auth_members pam JOIN
pg_catalog.pg_roles r ON (pam.roleid = r.oid) JOIN
pg_catalog.pg_roles m ON (pam.member = m.oid) JOIN
pg_catalog.pg_roles g ON (pam.grantor = g.oid)WHERE r.rolname !~
'^pg_'ORDER BY role, member, grantor; role |
member | admin | inherit | set | grantor
------------------+------------------+-------+---------+-----+------------------ regress_du_role0
| regress_du_admin | t | t | t | postgres regress_du_role0 |
regress_du_role1 | t | t | t |
regress_du_admin regress_du_role0 | regress_du_role1 | f | t |
f | regress_du_role1 regress_du_role0 | regress_du_role1 | f |
f | t | regress_du_role2 regress_du_role0 | regress_du_role2 |
t | f | f | regress_du_admin regress_du_role0 |
regress_du_role2 | f | t | t |
regress_du_role1 regress_du_role0 | regress_du_role2 | f | f |
f | regress_du_role2 regress_du_role1 | regress_du_admin | t |
t | t | postgres regress_du_role1 | regress_du_role2 | t |
f | t | regress_du_admin regress_du_role2 | regress_du_admin |
t | t | t | postgres(10 rows)But is it worth inventing a new
psql command for this?
-----
Pavel Luzanov
view thread (15+ 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], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: psql: Add role's membership options to the \du+ command
In-Reply-To: <[email protected]>
* 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