I have around 50 of postgres database. I need to check all users with their respective database name. I know \du
gives the list of all users like,
List of roles
Role name | Attributes | Member of
----------------------------------+-----------------------------------+----------------------
foo Superuser {}
..
..
which doesn't display database name. I can manually login to each database and run \du
to see the list of users present in that database, but that would take lot of time. So is there single line command or simple workaround which can display user list with their respective database name ?