The PostgreSQL database server stores "change data" in WAL log file, and I wanted to parse the archive log file to sql like mysqlbinlog
parse binlog file to sql, That I can find the application execute sql. Does anyone have a tool like this?
WAL is short for Write Ahead Log. WALs are used in nearly all modern RDBMS systems to provide durable and atomic transactions. Simply put, any transaction performed on the database is first written out as a WAL file, then applied to the actual on-disk table data files. WAL files are strictly sequential.
You can use the pg_archivecleanup command to remove WAL from an archive (not pg_xlog ) that's not required by a given base backup. In general I suggest using PgBarman or a similar tool to automate your base backups and WAL retention though.
WAL Buffers The write ahead log (WAL) buffers are also called "transaction log buffers", which is an amount of memory allocation for storing WAL data. This WAL data is the metadata information about changes to the actual data, and is sufficient to reconstruct actual data during database recovery operations.
You can't. It's the changes to the actual disk blocks.
You can set the server to log all the SQL statements to file if you would like though. Not sure you'd be able to replay them without being very clear about transaction boundaries though.
This feature is currently under development. (Look for "logical replication" patches by Andres Freund.) It's a huge project, so don't hold your breath. The short answer is: It's currently not possible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With