How do MySQL logs compare to Postgresql logs?
MySQL has quite a few logs:
- InnoDB transaction log
- Binary log
- General query log
- Error log
- Slow query log
I know about Postgresql's WAL, which is equivalent to InnoDB's transaction log (correct?).
What about the other MySQL logs such as bin log - are there Postgresql equivalence of them?
As MySQL implements multiple storage engines, theres need for both binary log for incremental backups / replication and InnoDB transaction log for ACID compliance (Only with InnoDB storage engine) In postgres, WAL can be used both for replication and ACID compliance, so WAL combines binary log and InnoDB transaction log.
You can make postgres log queries to syslog / separete log with log_statement and log_duration . So you get both query log and with directive log_min_duration_statement you can implement slow query log.
I may have gotten some of the details slightly wrong, but I believe that:
As you mention, the WAL is like the innodb transaction log.
All logs tend to be found in /var/log/postgresql/postgresql.log)
There is no binary log file in standard PostgreSQL because it doesn't do replication, unlike MySQL. You can use things like Slony to add replication.
The error log is in postgresql.log
The slow query log also goes into this file.
The general query log is the same as setting the slow query limit to 0ms.