In response to Terry Fielder <terry(at)ashtonwoodshomes(dot)com>:
>
> 1) if I have multiple pids running queries, say all selects, I have no
> idea which pid is running which query
SELECT * FROM pg_stat_activity;
If the current_query column doesn't have the query in it, then you need
to tweak your postgres.conf settings:
http://www.postgresql.org/docs/8.3/static/monitoring-stats.html
--
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/