現在実行中のSQL文などの情報がデフォルトで参照するためには、以下のSQLを実行します。
no1=# SELECT * FROM pg_stat_activity; datid | datname | procpid | usesysid | usename | current_query | query_start | backend_start | client_addr | client_port -------+---------+---------+----------+----------+------------------------------+-------------+-------------------------------+-------------+------------- 16386 | no1 | 11950 | 10 | postgres | <command string not enabled> | | 2009-12-10 19:09:40.879053+09 | | -1 16386 | no1 | 12031 | 10 | postgres | <command string not enabled> | | 2009-12-10 19:25:45.834642+09 | | -1 (2 rows)
アクティビティモニターなどに利用できそうですね。