From 71a2736195890689ac27962795e2252fab5014b2 Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Fri, 18 Sep 2015 16:56:48 -0500 Subject: [PATCH] Add List Database Users as a postgres til. --- README.md | 1 + postgres/list-database-users.md | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 postgres/list-database-users.md diff --git a/README.md b/README.md index 8566ded..bb8e327 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,7 @@ smart people at [Hashrocket](http://hashrocket.com/). - [Limit Execution Time Of Statements](postgres/limit-execution-time-of-statements.md) - [List All Columns Of A Specific Type](postgres/list-all-columns-of-a-specific-type.md) - [List All Versions Of A Function](postgres/list-all-versions-of-a-function.md) +- [List Database Users](postgres/list-database-users.md) - [Send A Command To psql](postgres/send-a-command-to-psql.md) - [Special Math Operators](postgres/special-math-operators.md) - [String Contains Another String](postgres/string-contains-another-string.md) diff --git a/postgres/list-database-users.md b/postgres/list-database-users.md new file mode 100644 index 0000000..21977b3 --- /dev/null +++ b/postgres/list-database-users.md @@ -0,0 +1,13 @@ +# List Database Users + +Within `psql`, type `\du` to list all the users for a database and their +respective permissions. + +```bash +> \du + List of roles + Role name | Attributes | Member of +------------+------------------------------------------------+----------- + jbranchaud | Superuser, Create role, Create DB, Replication | {} + sampleuser | Create DB | {} + ```