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