Mysql – How do MySQL logs compare to Postgresql logs

MySQLpostgresqlreplicationtransaction-log

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?

Best Answer

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.