In this article, we will see how to check whether a user is connected or not to PostgreSQL server. We can get this information from the system view pg_stat_activity.
Check whether user ‘james’ is connected to PostgreSQL or not
select datname from pg_stat_activity where usename='james';
Continue reading How to check whether a user is connected to PostgreSQL or not