zawhtut
zawhtut

Reputation: 8551

SQL monitoring tool(windows) for Postgres database

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.

Upvotes: 4

Views: 5097

Answers (3)

TraviJuu
TraviJuu

Reputation: 376

pgBadger is also good log analyzer tool that you can use.

Upvotes: 2

arvind
arvind

Reputation: 1493

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

Upvotes: 8

anon
anon

Reputation:

You can use pgFouine to examine the PostgreSQL logs and examine the commands that are being run.

Upvotes: 2

Related Questions