PostgreSQL user listing
问题 I want to get a list of users for a certain database in psql - for example "template0". Who are the users? Or for "template1" database: - who are the users there? Already tried: \du+ -- no database is Listed not Users Select * from "pg_users"; -- no database is listed 回答1: User aren't actually, "for the database", they're for cluster and are given different permissions to access databases. To list users \du should do, but you need to be connected. Something like psql template1 -c '\du' from