The format is complex and low-level, as other answers imply.
However, if you have time to learn and understand the stored data and how to build a binary file from the source, there is a published reader for versions 8.3 to 9.2 : xlogdump
The usual way to create it is as a tab (Postgres add-on):
- First, get the source for the Postgres version for which you want to view the WAL data.
./configure and make , but no need to install
- Then copy the xlogdump folder to the contrib folder (the git clone in this folder works fine)
- Run
make for xlogdump - it should find the postgres parent structure and build the binary
You can copy the binary to your path or use it in place. Be careful, you still need to know the internal knowledge of Postgres before you understand what you are looking at. If you have an available database, you can try to cancel SQL queries from the log.
To accomplish this in Java, you can either wrap the executable, link the C library as a hybrid, or figure out how to do the parsing you need from the source. Any of these options will likely require a lot of detailed work.
source share