OP asked for users connected to a particular database:
-- Who's currently connected to my_great_database?
SELECT * FROM pg_stat_activity
WHERE datname = 'my_great_database';
This gets you all sorts of juicy info (as others have mentioned) such as
usesysid
)usename
)appname
), if it bothers to set that variable -- psql
does :-)client_addr
)query
)