Re: Show INHERIT in \du - Mailing list pgsql-hackers

From Brendan Jurd
Subject Re: Show INHERIT in \du
Date
Msg-id 37ed240d0802170256t15ac4815hb8bc0ffbced46003@mail.gmail.com
Whole thread Raw
In response to Re: Show INHERIT in \du  ("Brendan Jurd" <direvus@gmail.com>)
Responses Re: [PATCHES] Show INHERIT in \du
Re: [PATCHES] Show INHERIT in \du
Re: [PATCHES] Show INHERIT in \du
Re: [PATCHES] Show INHERIT in \du
List pgsql-hackers
I've done up a patch per Tom's idea of combining the binary role
attributes into a single column.

Each attribute which differs from the default is listed on a separate
line, like so:

                  List of roles
  Role name  |   Attributes   |     Member of
-------------+----------------+-------------------
 bob         |                | {readers,writers}
 brendanjurd | Superuser      | {}
             : Create role
             : Create DB
 harry       | No inherit     | {}
 jim         | 10 connections | {readers}
 readers     | No login       | {}
 writers     | No login       | {}
(6 rows)

Notes:

 * The patch relies on array_to_string's current treatment of NULL
values in the array; they are ignored.  If that behaviour changes in
the future, the \du output will become very ugly indeed.
 * I'm not sure whether "No login" and "No inherit" are the best
phrases to use.  I took my cue from the SQL setting names NOLOGIN and
NOINHERIT, but maybe something more grammatically sensible with
"Cannot login" and "No inheritance" would be preferable.
 * If accepted, this patch would supercede the earlier patch mentioned
by Bernd Helmle upthread, which adds LOGIN to the output as a new
column: http://archives.postgresql.org/pgsql-patches/2007-11/msg00014.php

Cheers,
BJ

Attachment

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: CVS repository invalid revision
Next
From: Suresh
Date:
Subject: Doubt in IndexScanDescData