Re: Data Restore from WAL - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Data Restore from WAL
Date
Msg-id 45DED02B.9050704@enterprisedb.com
Whole thread Raw
In response to Data Restore from WAL  ("Vishal Arora" <aroravishal22@hotmail.com>)
List pgsql-hackers
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  EnterpriseDB   http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: "Simon Riggs"
Date:
Subject: Re: Simple Column reordering
Next
From: Peter Eisentraut
Date:
Subject: Re: Simple Column reordering