I want to trace all the queries done from Web Application to PostgreSQL server during a specific time interval. I have searched all over the internet and found below 3 approaches:
- pg_stat_activity which traces only current running queries
- pg_stat_statements which traces all the queries(including queries running internally on postgresql server). Below is the snapshot of pg_stat_activity. I am hardly getting anything useful from this
- Database logs (i think it will log all the queries)
But I want to trace the queries done from my web application.
how can i do that?