Vishal Arora wrote:
I would like to know how the data is been read from WAL file. If anyone can help me with the WAL file structure. What are the basic functions used by a pg_restore call.

pg_restore has nothing to do with WAL.

AFAIK the best description of the WAL file structure is in the comments in the source code. I'd suggest starting by reading the header files under src/include/access/xlog.h and src/include/access/xlog_utils.h, and the source file in src/backend/access/transam/xlog.c.

Basically each file in pg_xlog (aka WAL segment) is divided into fixed size pages, and pages are filled with WAL records.

For more information on the internals of pg_restore, look at the corresponding source and header files in src/bin/pg_dump.

Mind you, both the WAL file format and the binary pg_dump/pg_restore file format are internal to PostgreSQL, and not designed to be readable by external applications. The format can also change between releases.

  Heikki Linnakangas

---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at


Reply via email to