select usename, count(usename), client_hostname, xact_start
from pg_stat_activity
where datname = 'mydatabasename'