Re: PITR Archive Recovery

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: ohp(at)pyrenet(dot)fr
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: PITR Archive Recovery
Date: 2004-06-30 18:29:14
Message-ID: 1088620153.3266.9619.camel@stromboli
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

On Wed, 2004-06-30 at 12:27, ohp(at)pyrenet(dot)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

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Joe Conway 2004-06-30 19:10:40 contrib/fuzzystrmatch updates
Previous Message Dennis Bjorklund 2004-06-30 18:01:51 Re: psql schema permissions