Re: psql: Add role's membership options to the \du+ command

2023-07-20 Thread Jonathan S. Katz
On 7/19/23 1:44 PM, Pavel Luzanov wrote: On 19.07.2023 19:47, Tom Lane wrote: And done, with some minor editorialization. Thanks to everyone who participated in the work. Special thanks to David for moving forward this patch for a long time, and to Tom for taking commit responsibilities.

Re: psql: Add role's membership options to the \du+ command

2023-07-19 Thread Pavel Luzanov
On 19.07.2023 19:47, Tom Lane wrote: And done, with some minor editorialization. Thanks to everyone who participated in the work. Special thanks to David for moving forward this patch for a long time, and to Tom for taking commit responsibilities. -- Pavel Luzanov Postgres Professional:

Re: psql: Add role's membership options to the \du+ command

2023-07-19 Thread David G. Johnston
On Wed, Jul 19, 2023 at 9:47 AM Tom Lane wrote: > I wrote: > > Alvaro Herrera writes: > >> +1 for backpatching to 16, given that it's a psql-only change that > >> pertains to a backend change that was done in the 16 timeframe. > > > Agreed. In the interests of moving things along, I'll take

Re: psql: Add role's membership options to the \du+ command

2023-07-19 Thread Tom Lane
I wrote: > Alvaro Herrera writes: >> +1 for backpatching to 16, given that it's a psql-only change that >> pertains to a backend change that was done in the 16 timeframe. > Agreed. In the interests of moving things along, I'll take point > on getting this committed. And done, with some minor

Re: psql: Add role's membership options to the \du+ command

2023-07-19 Thread Tom Lane
Alvaro Herrera writes: > I tried this out. It looks good to me, and I like it. Not translating > the labels seems correct to me. > +1 for backpatching to 16, given that it's a psql-only change that > pertains to a backend change that was done in the 16 timeframe. Agreed. In the interests of

Re: psql: Add role's membership options to the \du+ command

2023-07-19 Thread Alvaro Herrera
I tried this out. It looks good to me, and I like it. Not translating the labels seems correct to me. +1 for backpatching to 16, given that it's a psql-only change that pertains to a backend change that was done in the 16 timeframe. Regarding the controversy of showing SET for previous

Re: psql: Add role's membership options to the \du+ command

2023-07-13 Thread Pavel Luzanov
On 13.07.2023 11:26, Pavel Luzanov wrote: And for versions <16 I forget to simplify expression for 'Options' column after removing LEFT JOIN on pam: SELECT m.rolname AS "Role name", r.rolname AS "Member of",   pg_catalog.concat_ws(', ',     CASE WHEN pam.admin_option THEN 'ADMIN' END,     CASE

Re: psql: Add role's membership options to the \du+ command

2023-07-13 Thread Tom Lane
Pavel Luzanov writes: > On 13.07.2023 18:01, Tom Lane wrote: >> 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

Re: psql: Add role's membership options to the \du+ command

2023-07-13 Thread Pavel Luzanov
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

Re: psql: Add role's membership options to the \du+ command

2023-07-13 Thread David G. Johnston
On Thu, Jul 13, 2023 at 8:01 AM Tom Lane wrote: > > I plan to replace it to: > > >pg_catalog.concat_ws(', ', > > CASE WHEN pam.admin_option THEN 'ADMIN' END, > > CASE WHEN m.rolinherit THEN 'INHERIT' END, > > 'SET' > >) AS "Options", > > That does not seem right. Is it

Re: psql: Add role's membership options to the \du+ command

2023-07-13 Thread Tom Lane
Pavel Luzanov writes: > On 08.07.2023 20:07, Tom Lane wrote >> 3. Not sure about use of LEFT JOIN in the query. That will mean we >> get a row out even for roles that have no grants, which seems like >> clutter. The LEFT JOINs to r and g are fine, but I suggest changing >> the first join to a

Re: psql: Add role's membership options to the \du+ command

2023-07-13 Thread Pavel Luzanov
On 08.07.2023 20:07, Tom Lane wrote 3. Not sure about use of LEFT JOIN in the query. That will mean we get a row out even for roles that have no grants, which seems like clutter. The LEFT JOINs to r and g are fine, but I suggest changing the first join to a plain join. Hm. Can you explain

Re: psql: Add role's membership options to the \du+ command

2023-07-12 Thread Pavel Luzanov
On 09.07.2023 13:56, Pavel Luzanov wrote: On 08.07.2023 20:07, Tom Lane wrote: 1. I was thinking in terms of dropping the "Member of" column entirely in \du and \dg. It doesn't tell you enough, and the output of those commands is often too wide already. 2. You have describeRoleGrants() set

Re: psql: Add role's membership options to the \du+ command

2023-07-09 Thread Pavel Luzanov
On 08.07.2023 20:07, Tom Lane wrote: 1. I was thinking in terms of dropping the "Member of" column entirely in \du and \dg. It doesn't tell you enough, and the output of those commands is often too wide already. I understood it that way that the dropping "Member of" column will be done as

Re: psql: Add role's membership options to the \du+ command

2023-07-08 Thread Tom Lane
Pavel Luzanov writes: > Please find attached new patch version. > It implements \drg command and hides duplicates in \du & \dg commands. I took a quick look through this, and have some minor suggestions: 1. I was thinking in terms of dropping the "Member of" column entirely in \du and \dg. It

Re: psql: Add role's membership options to the \du+ command

2023-06-26 Thread Pavel Luzanov
Please find attached new patch version. It implements \drg command and hides duplicates in \du & \dg commands. -- Pavel Luzanov Postgres Professional: https://postgrespro.com From a117f13fd497bf6ff8a504bcda6cb10d34dd22a7 Mon Sep 17 00:00:00 2001 From: Pavel Luzanov Date: Mon, 26 Jun 2023

Re: psql: Add role's membership options to the \du+ command

2023-06-25 Thread Pavel Luzanov
On 24.06.2023 18:57, David G. Johnston wrote: On Sat, Jun 24, 2023 at 8:11 AM Pavel Luzanov wrote: There are two commands showing the same information about roles: \du and \dr. I would add \dr as the new official command to complement adding \drg and deprecate both \du and \dg. 

Re: psql: Add role's membership options to the \du+ command

2023-06-24 Thread David G. Johnston
On Sat, Jun 24, 2023 at 8:11 AM Pavel Luzanov wrote: > Notes > * The name of the new command. It's a good name, if not for the history. > There are two commands showing the same information about roles: \du and > \dr. > The addition of \drg may be misinterpreted: if there is \drg, then there >

Re: psql: Add role's membership options to the \du+ command

2023-06-24 Thread Pavel Luzanov
Thank you for all valuable comments. I can now continue working on the patch. Here's what I plan to do in the next version. Changes for \du & \dg commands * showing distinct roles in the "Member of" column * explicit order for list of roles * no changes for extended mode (\du+) New

Re: psql: Add role's membership options to the \du+ command

2023-06-23 Thread David G. Johnston
On Fri, Jun 23, 2023 at 5:12 PM Tom Lane wrote: > "David G. Johnston" writes: > > On Thu, Jun 22, 2023 at 5:08 PM Tom Lane wrote: > >> * Personally I could do without the "empty" business, but that seems > >> unnecessary in the tabular format; an empty column will serve fine. > > > I disagree,

Re: psql: Add role's membership options to the \du+ command

2023-06-23 Thread Tom Lane
"David G. Johnston" writes: > On Thu, Jun 22, 2023 at 5:08 PM Tom Lane wrote: >> * Personally I could do without the "empty" business, but that seems >> unnecessary in the tabular format; an empty column will serve fine. > I disagree, but not strongly. > I kinda expected you to be on the side

Re: psql: Add role's membership options to the \du+ command

2023-06-23 Thread Jonathan S. Katz
On 6/23/23 12:16 PM, Tom Lane wrote: "David G. Johnston" writes: On Thu, Jun 22, 2023 at 5:08 PM Tom Lane wrote: * I agree that the "tabular" format looks nicer and has fewer i18n issues than the other proposals. As you are on board with a separate command please clarify whether you mean

Re: psql: Add role's membership options to the \du+ command

2023-06-23 Thread Jonathan S. Katz
On 6/23/23 11:52 AM, David G. Johnston wrote: On Thu, Jun 22, 2023 at 5:08 PM Tom Lane > wrote: "Jonathan S. Katz" mailto:jk...@postgresql.org>> writes: > On 6/15/23 2:47 PM, David G. Johnston wrote: >> Robert - can you please comment on what you are

Re: psql: Add role's membership options to the \du+ command

2023-06-23 Thread Tom Lane
"David G. Johnston" writes: > On Thu, Jun 22, 2023 at 5:08 PM Tom Lane wrote: >> * I agree that the "tabular" format looks nicer and has fewer i18n >> issues than the other proposals. > As you are on board with a separate command please clarify whether you mean > the tabular format but still

Re: psql: Add role's membership options to the \du+ command

2023-06-23 Thread David G. Johnston
On Thu, Jun 22, 2023 at 5:08 PM Tom Lane wrote: > "Jonathan S. Katz" writes: > > On 6/15/23 2:47 PM, David G. Johnston wrote: > >> 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

Re: psql: Add role's membership options to the \du+ command

2023-06-22 Thread Tom Lane
"Jonathan S. Katz" writes: > On 6/15/23 2:47 PM, David G. Johnston wrote: >> 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 >>

Re: psql: Add role's membership options to the \du+ command

2023-06-19 Thread Jonathan S. Katz
On 6/15/23 2:47 PM, David G. Johnston wrote: 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

Re: psql: Add role's membership options to the \du+ command

2023-06-15 Thread David G. Johnston
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.

Re: psql: Add role's membership options to the \du+ command

2023-05-18 Thread Pavel Luzanov
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:

Re: psql: Add role's membership options to the \du+ command

2023-05-17 Thread Jonathan S. Katz
On 5/7/23 3:14 PM, Pavel Luzanov wrote: On 05.05.2023 19:51, David G. Johnston wrote: But if it is really a blocker then maybe we should produce 3 separate newline separated columns, one for the member of role, one for the list of attributes, and one with the grantor.  The column headers can

Re: psql: Add role's membership options to the \du+ command

2023-05-07 Thread Pavel Luzanov
On 05.05.2023 19:51, David G. Johnston wrote: But if it is really a blocker then maybe we should produce 3 separate newline separated columns, one for the member of role, one for the list of attributes, and one with the grantor.  The column headers can be translated more easily as single

Re: psql: Add role's membership options to the \du+ command

2023-05-05 Thread David G. Johnston
On Wed, May 3, 2023 at 9:30 AM Jonathan S. Katz wrote: > [Personal hat] > > Looking at Pavel's latest patch, I do find the output easy to > understand, though do we need to explicitly list "empty" if there are no > membership permissions? > > Yes. I dislike having the equivalent of null

Re: psql: Add role's membership options to the \du+ command

2023-05-03 Thread Jonathan S. Katz
On 5/3/23 12:25 PM, Tom Lane wrote: "David G. Johnston" writes: On Wed, May 3, 2023 at 9:00 AM Jonathan S. Katz wrote: I don't see why this is an open item as this feature was not committed for v16. Open items typically revolve around committed features. The argument is that updating the

Re: psql: Add role's membership options to the \du+ command

2023-05-03 Thread Tom Lane
"David G. Johnston" writes: > On Wed, May 3, 2023 at 9:00 AM Jonathan S. Katz > wrote: >> I don't see why this is an open item as this feature was not committed >> for v16. Open items typically revolve around committed features. > The argument is that updating the psql \d views to show the

Re: psql: Add role's membership options to the \du+ command

2023-05-03 Thread David G. Johnston
On Wed, May 3, 2023 at 9:00 AM Jonathan S. Katz wrote: > On 4/13/23 8:44 AM, Pavel Luzanov wrote: > > > P.S. If no objections I plan to add this patch to Open Items for v16 > > https://wiki.postgresql.org/wiki/PostgreSQL_16_Open_Items > > [RMT hat] > > I don't see why this is an open item as

Re: psql: Add role's membership options to the \du+ command

2023-05-03 Thread Jonathan S. Katz
On 4/13/23 8:44 AM, Pavel Luzanov wrote: P.S. If no objections I plan to add this patch to Open Items for v16 https://wiki.postgresql.org/wiki/PostgreSQL_16_Open_Items [RMT hat] I don't see why this is an open item as this feature was not committed for v16. Open items typically revolve

Re: psql: Add role's membership options to the \du+ command

2023-04-15 Thread Pavel Luzanov
On 14.04.2023 10:28, Kyotaro Horiguchi wrote: As David-G appears to express concern in upthread, I don't think a direct Japanese translation from "rolename from rolename" works well, as the "from" needs accompanying verb. I, as a Japanese speaker, I prefer a more non-sentence-like notation,

Re: psql: Add role's membership options to the \du+ command

2023-04-14 Thread Kyotaro Horiguchi
Sorry for joining in late.. At Thu, 13 Apr 2023 15:44:20 +0300, Pavel Luzanov wrote in > After playing with the \du command, I found that we can't avoid > translation. > All attributes are translatable. Also, two of nine attributes shows in > new line separated format (connection limit and

Re: psql: Add role's membership options to the \du+ command

2023-04-13 Thread Pavel Luzanov
After playing with the \du command, I found that we can't avoid translation. All attributes are translatable. Also, two of nine attributes shows in new line separated format (connection limit and password valid until). $ LANGUAGE=fr psql -c "ALTER ROLE postgres CONNECTION LIMIT 3 VALID UNTIL

Re: psql: Add role's membership options to the \du+ command

2023-04-05 Thread David G. Johnston
On Wed, Apr 5, 2023 at 6:58 AM Tom Lane wrote: > Pavel Luzanov writes: > > What if this long output will be available only for \du+, and for \du > > just show distinct (without duplicates) > > roles in the current array format? For those, who don't care about these > > new membership options,

Re: psql: Add role's membership options to the \du+ command

2023-04-05 Thread Tom Lane
Pavel Luzanov writes: > What if this long output will be available only for \du+, and for \du > just show distinct (without duplicates) > roles in the current array format? For those, who don't care about these > new membership options, nothing will change. > Those, who need details will use

Re: psql: Add role's membership options to the \du+ command

2023-04-05 Thread Pavel Luzanov
On 04.04.2023 22:02, David G. Johnston wrote: On Tue, Apr 4, 2023 at 10:37 AM Tom Lane wrote: Robert Haas writes: > On Tue, Apr 4, 2023 at 1:12 PM Tom Lane wrote: >> I wonder if, while we're here, we should apply the idea of >> joining-with-newlines-not-commas to the

Re: psql: Add role's membership options to the \du+ command

2023-04-04 Thread Pavel Luzanov
On 04.04.2023 23:00, Robert Haas wrote: On Tue, Apr 4, 2023 at 3:02 PM David G. Johnston wrote: So, by way of example: regress_du_role1 | cannot login | regress_du_role0 granted by regress_du_admin with admin, inherit, set | Description for regress_du_role1 That seems wider than necessary.

Re: psql: Add role's membership options to the \du+ command

2023-04-04 Thread Robert Haas
On Tue, Apr 4, 2023 at 3:02 PM David G. Johnston wrote: > So, by way of example: > > regress_du_role1 | cannot login | regress_du_role0 granted by > regress_du_admin with admin, inherit, set | Description for regress_du_role1 > > ~140 character width with description That seems wider than

Re: psql: Add role's membership options to the \du+ command

2023-04-04 Thread David G. Johnston
On Tue, Apr 4, 2023 at 10:37 AM Tom Lane wrote: > Robert Haas writes: > > On Tue, Apr 4, 2023 at 1:12 PM Tom Lane wrote: > >> I wonder if, while we're here, we should apply the idea of > >> joining-with-newlines-not-commas to the attributes column too. > > > That would make the column

Re: psql: Add role's membership options to the \du+ command

2023-04-04 Thread Tom Lane
Robert Haas writes: > On Tue, Apr 4, 2023 at 1:12 PM Tom Lane wrote: >> I wonder if, while we're here, we should apply the idea of >> joining-with-newlines-not-commas to the attributes column too. > That would make the column narrower, which might be good, because it > seems to me that listing

Re: psql: Add role's membership options to the \du+ command

2023-04-04 Thread Robert Haas
On Tue, Apr 4, 2023 at 1:12 PM Tom Lane wrote: > 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. That would make the column narrower, which might be good,

Re: psql: Add role's membership options to the \du+ command

2023-04-04 Thread Tom Lane
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

Re: psql: Add role's membership options to the \du+ command

2023-04-04 Thread Robert Haas
On Tue, Apr 4, 2023 at 12:13 PM Tom Lane wrote: > Hmm ... not sure I like the proposed output. The 'a', 'i', 's' > annotations are short but they don't have much else to recommend them. Yeah, I don't like that, either. I'm not sure what the right thing to do is here. It's a problem to have new

Re: psql: Add role's membership options to the \du+ command

2023-04-04 Thread David G. Johnston
On Tue, Apr 4, 2023 at 9:13 AM Tom Lane wrote: > "David G. Johnston" writes: > > I've marked this Ready for Committer. > > Hmm ... not sure I like the proposed output. The 'a', 'i', 's' > annotations are short but they don't have much else to recommend them. > On the other hand, there's nearby

Re: psql: Add role's membership options to the \du+ command

2023-04-04 Thread Tom Lane
"David G. Johnston" writes: > I've marked this Ready for Committer. Hmm ... not sure I like the proposed output. The 'a', 'i', 's' annotations are short but they don't have much else to recommend them. On the other hand, there's nearby precedent for single-letter abbreviations in ACL displays.

Re: psql: Add role's membership options to the \du+ command

2023-04-03 Thread David G. Johnston
On Wed, Mar 22, 2023 at 11:11 AM Pavel Luzanov wrote: > In the previous version, I didn't notice (unlike cfbot) the compiler > warning. Fixed in version 6. > > I've marked this Ready for Committer. My opinion is that this is a necessary modification due to the already-committed changes to the

Re: psql: Add role's membership options to the \du+ command

2023-03-22 Thread Pavel Luzanov
In the previous version, I didn't notice (unlike cfbot) the compiler warning. Fixed in version 6. - Pavel Luzanov From 1b8b5743df23637b70e8d4ad0df0e1f892c595f3 Mon Sep 17 00:00:00 2001 From: Pavel Luzanov Date: Wed, 22 Mar 2023 20:54:41 +0300 Subject: [PATCH v6] psql: show membership

Re: psql: Add role's membership options to the \du+ command

2023-03-20 Thread Pavel Luzanov
I would suggest tweaking the test output to include regress_du_admin ... I found (with a help of cfbot) difficulty with this. The problem is the bootstrap superuser name (oid=10). This name depends on the OS username. In my case it's pal, but in most cases it's postgres or something else. And

Re: psql: Add role's membership options to the \du+ command

2023-03-20 Thread Pavel Luzanov
On 10.03.2023 15:06, Pavel Luzanov wrote: I missed the comment at the beginning of the file about version 9.2. I will return the version check for rolbypassrls. +         +        Shown within each row, in newline-separated format, are the memberships granted to +        the role.  The

Re: psql: Add role's membership options to the \du+ command

2023-03-10 Thread Pavel Luzanov
On 08.03.2023 00:02, David G. Johnston wrote: FWIW I've finally gotten to publishing my beta version of the Role Graph for PostgreSQL pseudo-extension I'd been talking about: https://github.com/polobo/RoleGraphForPostgreSQL Great. So far I've looked very briefly, but it's interesting. I

Re: psql: Add role's membership options to the \du+ command

2023-03-10 Thread Pavel Luzanov
On 08.03.2023 05:31, David G. Johnston wrote: Moving the goal posts for this meta-command to >= 9.5 seems like it should be done as a separate patch and thread.  The documentation presently states we are targeting 9.2 and newer. I missed the comment at the beginning of the file about version

Re: psql: Add role's membership options to the \du+ command

2023-03-07 Thread David G. Johnston
On Tue, Mar 7, 2023 at 2:02 PM David G. Johnston wrote: > > I'll be looking over your v3 patch sometime this week, if not today. > > Moving the goal posts for this meta-command to >= 9.5 seems like it should be done as a separate patch and thread. The documentation presently states we are

Re: psql: Add role's membership options to the \du+ command

2023-03-07 Thread David G. Johnston
On Mon, Mar 6, 2023 at 12:43 AM Pavel Luzanov wrote: > Indeed, adding ADMIN to pg_has_role looks logical. The function will show > whether one role can manage another directly or indirectly (via SET ROLE). > FWIW I've finally gotten to publishing my beta version of the Role Graph for PostgreSQL

Re: psql: Add role's membership options to the \du+ command

2023-03-05 Thread Pavel Luzanov
On 03.03.2023 19:21, David G. Johnston wrote: I'd be fine with "pg_can_admin_role" being a newly created function that provides this true/false answer but it seems indisputable that today there is no core-provided means to answer the question "can one role get ADMIN rights on another role". 

Re: psql: Add role's membership options to the \du+ command

2023-03-03 Thread David G. Johnston
On Fri, Mar 3, 2023 at 4:01 AM Pavel Luzanov wrote: > Hello, > > On 22.02.2023 00:34, David G. Johnston wrote: > > I didn't even know this function existed. But I see that it was changed in > 3d14e171 with updated documentation: > >

Re: psql: Add role's membership options to the \du+ command

2023-03-03 Thread Pavel Luzanov
Hello, On 22.02.2023 00:34, David G. Johnston wrote: I didn't even know this function existed. But I see that it was changed in 3d14e171 with updated documentation: https://www.postgresql.org/docs/devel/functions-info.html#FUNCTIONS-INFO-ACCESS Maybe that's enough. I think that should

Re: psql: Add role's membership options to the \du+ command

2023-03-01 Thread Pavel Luzanov
Next version (v3) addresses complains from cfbot. Changed only tests. -- Pavel Luzanov Postgres Professional: https://postgrespro.com From 6db62993d4b7afbcbce3e63ce3fbe3946ec50cff Mon Sep 17 00:00:00 2001 From: Pavel Luzanov Date: Wed, 1 Mar 2023 13:29:10 +0300 Subject: [PATCH v3] psql: \du

Re: psql: Add role's membership options to the \du+ command

2023-02-27 Thread Pavel Luzanov
On 22.02.2023 00:34, David G. Johnston wrote: This is the format I've gone for (more-or-less) in my RoleGraph view (I'll be sharing it publicly in the near future). bob from grantor (a, s, i) \n adam from postgres (a, s, i) \n emily from postgres (empty) I think this is a good compromise.

Re: psql: Add role's membership options to the \du+ command

2023-02-21 Thread David G. Johnston
On Tue, Feb 21, 2023 at 2:14 PM Pavel Luzanov wrote: > On 17.02.2023 19:53, David G. Johnston wrote: > > On Fri, Feb 17, 2023 at 4:02 AM Pavel Luzanov > wrote: > >>List of roles >> Role name | Attributes | >>

Re: psql: Add role's membership options to the \du+ command

2023-02-21 Thread Pavel Luzanov
On 17.02.2023 19:53, David G. Johnston wrote: On Fri, Feb 17, 2023 at 4:02 AM Pavel Luzanov wrote:                                List of roles  Role name | Attributes | Member of

Re: psql: Add role's membership options to the \du+ command

2023-02-17 Thread David G. Johnston
On Fri, Feb 17, 2023 at 4:02 AM Pavel Luzanov wrote: >List of roles > Role name | Attributes | > Member of > > ---++--- > admin |

Re: psql: Add role's membership options to the \du+ command

2023-02-17 Thread Pavel Luzanov
Hello, On the one hand, it would be nice to see the membership options with the psql command. After playing with cf5eb37c and e5b8a4c0 I think something must be made with \du command. postgres@demo(16.0)=# CREATE ROLE admin LOGIN CREATEROLE; CREATE ROLE postgres@demo(16.0)=# \c - admin You

Re: psql: Add role's membership options to the \du+ command

2023-02-16 Thread Pavel Luzanov
On 16.02.2023 00:37, David G. Johnston wrote: I mean, either you accept the change in how this meta-command presents its information or you don't. Yes, that's the main issue of this patch. On the one hand, it would be nice to see the membership options with the psql command. On the other

Re: psql: Add role's membership options to the \du+ command

2023-02-15 Thread David Zhang
On 2023-02-15 1:37 p.m., David G. Johnston wrote: On Wed, Feb 15, 2023 at 2:31 PM David Zhang wrote: There is a default built-in role `pg_monitor` and the behavior changed after the patch. If `\dg+` and `\du+` is treated as the same, and `make check` all pass, then I assume there

Re: psql: Add role's membership options to the \du+ command

2023-02-15 Thread David G. Johnston
On Wed, Feb 15, 2023 at 2:31 PM David Zhang wrote: > There is a default built-in role `pg_monitor` and the behavior changed > after the patch. If `\dg+` and `\du+` is treated as the same, and `make > check` all pass, then I assume there is no test case to verify the output > of `duS+`. My point

Re: psql: Add role's membership options to the \du+ command

2023-02-15 Thread David Zhang
On 2023-02-10 2:27 p.m., David G. Johnston wrote: On Fri, Feb 10, 2023 at 2:08 PM David Zhang wrote: I noticed the document psql-ref.sgml has been updated for both `du+` and `dg+`, but only `du` and `\du+` are covered in regression test. Is that because `dg+` is treated

Re: psql: Add role's membership options to the \du+ command

2023-02-10 Thread David G. Johnston
On Fri, Feb 10, 2023 at 2:08 PM David Zhang wrote: > > I noticed the document psql-ref.sgml has been updated for both `du+` and > `dg+`, but only `du` and `\du+` are covered in regression test. Is that > because `dg+` is treated exactly the same as `du+` from testing point of > view? > Yes. >

Re: psql: Add role's membership options to the \du+ command

2023-02-10 Thread David Zhang
Thanks a lot for the improvement, and it will definitely help provide more very useful information. I noticed the document psql-ref.sgml has been updated for both `du+` and `dg+`, but only `du` and `\du+` are covered in regression test. Is that because `dg+` is treated exactly the same as

Re: psql: Add role's membership options to the \du+ command

2023-01-26 Thread Pavel Luzanov
On 24.01.2023 20:16, David G. Johnston wrote: Yeah, I noticed the lack too, then went a bit too far afield with trying to compose a graph of the roles.  I'm still working on that but at this point it probably won't be something I try to get committed to psql.  Something more limited like this

Re: psql: Add role's membership options to the \du+ command

2023-01-24 Thread David G. Johnston
On Mon, Jan 9, 2023 at 9:09 AM Pavel Luzanov wrote: > When you include one role in another, you can specify three options: > ADMIN, INHERIT (added in e3ce2de0) and SET (3d14e171). > > For example. > > CREATE ROLE alice LOGIN; > > GRANT pg_read_all_settings TO alice WITH ADMIN TRUE, INHERIT TRUE,

Re: psql: Add role's membership options to the \du+ command

2023-01-10 Thread Pavel Luzanov
Added the patch to the open commitfest: https://commitfest.postgresql.org/42/4116/ Feel free to reject if it's not interesting. -- Pavel Luzanov

psql: Add role's membership options to the \du+ command

2023-01-09 Thread Pavel Luzanov
When you include one role in another, you can specify three options: ADMIN, INHERIT (added in e3ce2de0) and SET (3d14e171). For example. CREATE ROLE alice LOGIN; GRANT pg_read_all_settings TO alice WITH ADMIN TRUE, INHERIT TRUE, SET TRUE; GRANT pg_stat_scan_tables TO alice WITH ADMIN FALSE,