I keep this one line as .sql in my home directory of all the work machines:
## PG10 Syntax
SELECT datname,usename,pid,client_addr,wait_event,query_start,query
FROM pg_stat_activity ;
checking what is going on is easy
psql -f short_queries_list.sql
per the manual
http://www.postgresql.org/docs/current/static/monitoring-stats.html