Re: Data Restore from WAL

From: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
To: Vishal Arora <aroravishal22(at)hotmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Data Restore from WAL
Date: 2007-02-23 11:29:47
Message-ID: 45DED02B.9050704@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2007-02-23 11:56:02 Re: Simple Column reordering
Previous Message Simon Riggs 2007-02-23 11:25:22 Re: Simple Column reordering