On Thu, 2010-06-10 at 22:49 +0300, Heikki Linnakangas wrote:
> On 10/06/10 22:24, Dimitri Fontaine wrote:
> > Heikki Linnakangas<heikki.linnakan...@enterprisedb.com>  writes:
> >> Maybe we could add a new pg_cleanuparchive binary, but we'll need some
> >> discussion...
> >
> > Would this binary ever be used manually, not invoked by PostgreSQL? As
> > it depends on the %r option to be given and to be right, I don't think
> > so.
> 
> Hmm, actually it would be pretty handy. To make use of a base backup, 
> you need all the WAL files following the one where pg_start_backup() was 
> called. We create a .backup file in the archive to indicate that 
> location, like:
> 
> 00000001000000000000002F.00000020.backup
> 
> So to clean up all WAL files older than those needed by that base 
> backup, you would simply copy-paste that location and call 
> pg_cleanuparchive:
> 
> pg_cleanuparchive /walarchive/ 00000001000000000000002F

OK, sounds like we're on the same thought train.

Here's the code.

-- 
 Simon Riggs           www.2ndQuadrant.com
 PostgreSQL Development, 24x7 Support, Training and Services

Attachment: pg_archivecleanup.tar
Description: Unix tar archive

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to