Re: Apply WAL logs after database restore

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Brad Littlejohn" <blittlejohn(at)posportal(dot)com>, "'pgsql-admin(at)postgresql(dot)org'" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Apply WAL logs after database restore
Date: 2010-02-18 22:20:15
Message-ID: 4B7D68BF020000250002F3D4@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Brad Littlejohn <blittlejohn(at)posportal(dot)com> wrote:

> I performed a backup of the database, using pg_dump

> I have WAL-based log shipping enabled on that server.
>
> I just created a second database server that will be a recovery
> server, compiled and installed PostgreSQL onto it, and restored
> the full backup taken from the primary database onto it. Since
> this wasn't a base backup (using tar, cpio, etc.), how would I
> apply the WAL logs to this secondary server, to get it up to
> current?

That can't be done -- pg_dump uses COPY or INSERT statements
(depending on your pg_dump options) which are *row* based, while WAL
files are *page* based. They are alternative techniques which can't
be mixed and matched.

> All of the documentation I've read so far uses a base backup. Is
> there any way to apply the logs generated since that backup
> created by pg_dump to get the secondary database up to current?

No, you can only apply WAL files to a file-based image of the source
database, not to a database created through other means which
happens to contain the same data.

-Kevin

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Brad Littlejohn 2010-02-18 22:34:28 Re: Apply WAL logs after database restore
Previous Message Guillaume Lelarge 2010-02-18 22:19:18 Re: Apply WAL logs after database restore