how to get users in postgres code example Example 1: postgresql list users postgres=# \du Example 2: postgresql get current user name SELECT current_user;