[FIXED] How to read Postgres transaction log

Issue

I will want read all SQL query only committed transaction. I have Postgres 9.5 or can will update on PG 11. I need to get Transaction Log on SQL format

id='dv3'>

Solution

The transaction log (WAL) doesn't contain the SQL statements that ran, it contains the binary changes to the data files: things like “in block 42 of file 76183, change 24 bytes to something else”.

From PostgreSQL 9.6 on, there is logical decoding which enables a logical decoding plugin to parse this WAL information and “reverse engineer” logical information (like SQL statements) from the binary WAL information and the database metadata.

That is the direction you will have to take. Look at test_decoding and wal2json, maybe you'll find what you are looking for.

No luck with PostgreSQL 9.5 on that.



Answered By - Laurenz Albe
Answer Checked By - Marie Seifert (sql.easybugfix Admin)

Related Posts

Post a Comment