You can get the active server process and its related activities using pg_stat_activity:

SELECT
    *
FROM
    pg_stat_activity;

If you want to list all users, use pg_user:

SELECT
    *
FROM
    pg_user;

Show active connections PostgreSQL


Need a good GUI Tool for PostgreSQL? TablePlus is a modern, native tool with an elegant UI that allows you to simultaneously manage multiple databases such as MySQL, PostgreSQL, SQLite, Microsoft SQL Server and more.


Download TablePlus free.

TablePlus GUI Tool PostgreSQL