It is possible to setup the postmaster (Postgres server) in order to see which query is being executed. That can be very helpful to sort out too long reponse times.
last update 2009-07-31
- postmaster setup : Edit PG_HOME/postgresql.conf and add or uncomment the line stats_command_string = true
- Restart the service.
- At any time just run the query select * from pg_stat_activity ;