Reputation: 91
I am trying to read PostgreSQL wal
file. Its a binary file and I am not able to read wal
file data in text format. Can anyone help me for this.
Is there any command or something to read the wal
file data?
Upvotes: 9
Views: 18305
Reputation: 4098
Generally, there are two options in Postgres for presenting WALs in some human-readable format:
pg_waldump
utility, but it is available only in 9.3+. You can try using pg_waldump
from 9.3 with 9.2 WALs, but I am not sure in success. It may work, since there should not be any new WAL record types in 9.2, which do not exist in 9.3. Note: pg_waldump
was called pg_xlogdump
until Postgres 10.0wal2json
to export records in the human-readable format. Note: logical decoding may do not decode every WAL record, it is mostly about DML (insert/update/delete)Thus, I would strongly recommend to upgrade your cluster to Postgres 9.4 at least.
Upvotes: 8
Reputation: 56
You should use wal2json, but it only work for pg9.4+
https://github.com/eulerto/wal2json
Upvotes: 0