There is a simple way to get this all from psql.
First edit postgresql.conf and make sure:
stats_command_string = true
(and restart or HUP postmaster if necessary)
Then connect to your database and use my favorite query:
SELECT datname,procpid,current_query FROM pg_stat_activity ORDER BY procpid;
which will give you database name, pid and current query (or <IDLE>) for
each current connection to the database.
Note that you will see queries for all databases, not just the one you
connected to.
This is what I use for 7.1, I don't know if it differs for newer versions.
Cheers,
CM
--
Chris Miles
http://chrismiles.info/
Ramil Sagum wrote:
>
> is there any way to see what statements/queries are currently being passed
> on to the database?
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings