psql -d appdb -c '\du'

Category: Databases & SQL

psql -d appdb -c '\du'

List PostgreSQL roles and attributes

Shows each role from pg_roles with its superuser, createdb, and login flags. Use \du+ for more detail. A quick audit of who can do what before handing out grants.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.