I showed users(roles) with \dg and \du, then there were the same results as shown below:
postgres=# \dg
List of roles
Role name | Attributes
-----------+------------------------------------------------------------
anna |
john |
postgres | Superuser, Create role, Create DB, Replication, Bypass RLS
postgres=# \du
List of roles
Role name | Attributes
-----------+------------------------------------------------------------
anna |
john |
postgres | Superuser, Create role, Create DB, Replication, Bypass RLS
I also read the explanations of \dg and \du which are the same as shown below:
postgres=# \?
...
Informational
...
\dg[S+] [PATTERN] list roles
...
\du[S+] [PATTERN] list roles
...
My questions:
- What is the difference between
\dgand\du? - If
\dgand\duare the same, is one of them deprecated at the moment or in the future?
Using
psql --echo-hidden:You can see
\dgand\duare exactly the same thing:Neither is deprecated. It's not guaranteed that they won't be replaced or deprecated in the future, but it's generally unlikely.
\dglists groups,\dulists users, which both becamerolesin version 8.1.