how to check open connections in postgresql code example Example: psql connections SELECT * FROM pg_stat_activity;