Have a quick look about PostgreSQL current activities

 

Here is the SQL for PG9.2 and PG9.3

 

select usename, query from pg_stat_activity where datname='chimera' and query<>'<IDLE>';
usename  |             current_query
 postgres | DELETE FROM t_locationinfo_trash WHERE ilocation=$1 AND ipnfsid=$2 AND itype=1
 postgres | DELETE FROM t_locationinfo_trash WHERE ilocation=$1 AND ipnfsid=$2 AND itype=1
 postgres | SELECT ipnfsid FROM t_locationinfo_trash WHERE ilocation=$1 ORDER BY iatime
 postgres | DELETE FROM t_locationinfo_trash WHERE ilocation=$1 AND ipnfsid=$2 AND itype=1
 postgres | autovacuum: VACUUM ANALYZE public.t_locationinfo

 

Here is the SQL for PG9.1

select usename, current_query from pg_stat_activity where datname='testdb' and current_query<>'<IDLE>';
 usename  |             current_query
----------+------------------------------------------------------------------
 postgres | autovacuum: ANALYZE public.srmspace

Here is the SQL for pg9.4, Check Current PostgreSQL9.4 activities

Want to kill, or terminate a query ? see How to stop a postgre query