Re: PITR Archive Recovery - Mailing list pgsql-patches

From Simon Riggs
Subject Re: PITR Archive Recovery
Date
Msg-id 1088620153.3266.9619.camel@stromboli
Whole thread Raw
In response to Re: PITR Archive Recovery  (ohp@pyrenet.fr)
Responses Re: PITR Archive Recovery
Re: PITR Archive Recovery
List pgsql-patches
On Wed, 2004-06-30 at 12:27, ohp@pyrenet.fr wrote:
> Given that log files will be archieved, how can we purge them (ie know for
> sure we won't need them anymore)
>

Good question - you're right I've not mentioned that.

The answer is straightforward. Whenever you do a backup, one of the
transaction logs will be the current one. That means any logs before the
earliest one you can see can now be purged from the archive.

So if you can see: 137,138,139 then that means anything at 136 or before
is able to be discarded.

However, I'd recommend keeping more than just one backup, usually 2 or
3, so the actual purge point is dependant upon your data retention
strategy, possibly linked to tape rotation etc..

> if I do a backup of the DATA dir, then obviously I won't need the logs
> that were taken before. I can't just delete them all because maybe a few
> will be archived during the backup.
>

Taking a full physical backup will normally need to exclude the pg_xlog
directory, or at least the current xlog. Since it is being written to
very regularly it is almost impossible to take a clean copy using
standard utilities - though filesystem level utilities work fine.

Best regards, Simon Riggs


pgsql-patches by date:

Previous
From: Dennis Bjorklund
Date:
Subject: Re: psql schema permissions
Next
From: Joe Conway
Date:
Subject: contrib/fuzzystrmatch updates