Since PostgreSQL 9.3, the code tree is shipping a file named xlogreader.c that contains a set of independent routines that can be used to read and decode WAL records. While it is not available in an independent library, any frontend or backend application can use it at compilation to be able to work on WAL. The code of PostgreSQL uses it already in a couple of places, hence many examples are already available in core to help the development of plugins with this facility:
Read more...