I would like to know is there any postgres sql monitoring tool for windows ? The scenario is I would like to see the sql statements that come from the custom web application. Any kind help is appreciated.
-
1I've connected Aqua Data Studious to postgres as one of the few 3rd party tools that had some support for it. Unsure if it'll have the features you want and it has a price tag, but it'll resemble a windows tools a bit more for you.Twelfth– Twelfth2011-11-24 19:13:27 +00:00Commented Nov 24, 2011 at 19:13
3 Answers
PostgreSql has a very smart Log system. I use it to monitor queries and recommend it. It is very easy to operate and one can use just notepad to see queries plus the log can be organised by date.
Logs are stored in Installationfolder/data/pg_log folder. While log settings are placed in postgresql.conf file.
Log format is usually set as stderr. But CSV log format is recommended. In order to enable CSV format change in
- log_destination = 'stderr,csvlog'
- logging_collector = on
In order to log all queries, very usefull for new installations, set min. execution time of a query that will be logges
- log_min_duration_statement = 0
In order to view active Queries on your database, use
- SELECT * FROM pg_stat_activity
To log specific queries set query type
- log_statement = 'all' # none, ddl, mod, all
Comments
You can use pgFouine to examine the PostgreSQL logs and examine the commands that are being run.