psql: \dg and groups for \du

Started by Markus Bertheauover 22 years ago5 messagespatches
Jump to latest
#1Markus Bertheau
twanger@bluetwanger.de

Hi,

attached is a patch that adds display of the groups a user belongs to to
\du and a \dg command to psql. It's against 7.4beta5.

--
Markus Bertheau <twanger@bluetwanger.de>

Attachments:

psql-describe-group.patchtext/x-patch; charset=UTF-8; name=psql-describe-group.patchDownload+51-3
#2Bruce Momjian
bruce@momjian.us
In reply to: Markus Bertheau (#1)
Re: psql: \dg and groups for \du

I will write the psql.sgml changes.

Your patch has been added to the PostgreSQL unapplied patches list at:

http://momjian.postgresql.org/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---------------------------------------------------------------------------

Markus Bertheau wrote:

Hi,

attached is a patch that adds display of the groups a user belongs to to
\du and a \dg command to psql. It's against 7.4beta5.

--
Markus Bertheau <twanger@bluetwanger.de>

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#3Bruce Momjian
bruce@momjian.us
In reply to: Markus Bertheau (#1)
Re: psql: \dg and groups for \du

Nice:

test=> create group test;
CREATE GROUP
test=> \dg
List of database groups
Group name | Group ID
------------+----------
test | 100
(1 row)

test=> alter group test add user postgres;
ALTER GROUP
test=> \du
List of database users
User name | User ID | Attributes | Groups
-----------+---------+----------------------------+--------
postgres | 1 | superuser, create database | {test}
(1 row)

Patch applied, docs added, TODO updated. Thanks.

---------------------------------------------------------------------------

Markus Bertheau wrote:

Hi,

attached is a patch that adds display of the groups a user belongs to to
\du and a \dg command to psql. It's against 7.4beta5.

--
Markus Bertheau <twanger@bluetwanger.de>

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#4Peter Eisentraut
peter_e@gmx.net
In reply to: Bruce Momjian (#3)
Re: psql: \dg and groups for \du

Note that it is planned to unify users and groups into a general "role"
entity, so this command is probably going to go away soon.

Bruce Momjian writes:

Nice:

test=> create group test;
CREATE GROUP
test=> \dg
List of database groups
Group name | Group ID
------------+----------
test | 100
(1 row)

test=> alter group test add user postgres;
ALTER GROUP
test=> \du
List of database users
User name | User ID | Attributes | Groups
-----------+---------+----------------------------+--------
postgres | 1 | superuser, create database | {test}
(1 row)

Patch applied, docs added, TODO updated. Thanks.

---------------------------------------------------------------------------

Markus Bertheau wrote:

Hi,

attached is a patch that adds display of the groups a user belongs to to
\du and a \dg command to psql. It's against 7.4beta5.

--
Markus Bertheau <twanger@bluetwanger.de>

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

--
Peter Eisentraut peter_e@gmx.net

#5Bruce Momjian
bruce@momjian.us
In reply to: Peter Eisentraut (#4)
Re: psql: \dg and groups for \du

Peter Eisentraut wrote:

Note that it is planned to unify users and groups into a general "role"
entity, so this command is probably going to go away soon.

NP, at least the code is there for reuse.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073