"Tauren Mills" <tauren@servlets.net> writes:
> If there is not a tool to do this, how difficult would it be to build a tool
> to obtain this information? Or is there simply no way to extract this
> information from pgsql?
Coming soon to a 7.2 near you:
regression=# select * from pg_stat_activity;
datid | datname | procpid | usesysid | usename | current_query
--------+------------+---------+----------+----------+---------------------------------
400867 | regression | 29709 | 256 | postgres | select * from pg_stat_activity;
400867 | regression | 452 | 256 | postgres |
(2 rows)
(the second backend doesn't have collect_querystring turned on, so it's
not reporting its current query...)
Hopefully, Jan will get around to writing some documentation about
this before release ;-)
regards, tom lane