how to list connected sessions

psql -h pghost -U postgres -1 -c 'select * from pg_stat_activity'