How to parse postgresql wal log file for sql

The PostgreSQL database server stores the β€œdata changes” in the WAL log file, and I wanted to analyze the archive log file in sql, for example mysqlbinlog, split the binlog file into sql so that I can find the application to execute sql. Does anyone have such a tool?

+4
source share
4 answers

You can not. These are changes in real disk blocks.

You can configure the server to write all SQL statements to a file if you want. Not sure if you can reproduce them without knowing the boundaries of transactions.

+2
source

. ( " " .) , . : .

+2

If you feel adventurous, xlogdump can help you partially extract data from your WAL segments. If you really only need SQL that runs in your cluster, set log_min_duration_statement = 0to register all statements.

+1
source

You can now replicate using SQL. Take a look pglogical. However, it does not cover circuit changes.

0
source

All Articles