how to check active connection in psql code example Example: psql connections SELECT * FROM pg_stat_activity;