Re: Command to prune archive at restartpoints
Andrew Dunstan <andrew@dunslane.net>
From: Andrew Dunstan <andrew@dunslane.net>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Simon Riggs <simon@2ndquadrant.com>, Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>, Greg Stark <gsstark@mit.edu>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2010-06-10T14:38:20Z
Lists: pgsql-hackers
Robert Haas wrote: >> It won't kill us to change that sentence. "pg_standby is only used now >> within the cleanup command" etc >> >> pg_standby already contains the exact logic we need here. Having two >> sets of code for the same thing isn't how we do things. >> Well, we could factor out that part of the code so it could be used in two binaries. But ... >>> Maybe we could add a new pg_cleanuparchive binary, but we'll need some >>> discussion... >>> >> Which will go nowhere, as we both already know. >> > > I have a feeling that I may be poking my nose into an incipient > shouting match, but FWIW I agree with Heikki that it would be > preferable to keep this separate from pg_standby. Considering that > Andrew wrote this in 24 lines of Perl code (one-third of which are > basically just there for logging purposes), I'm not that worried about > code duplication, unless what we actually need is significantly more > complicated. > > I think my logic needs a tiny piece of adjustment, to ignore the timeline segment of the file name. But that will hardly involve a great deal of extra code - just chop off the first 8 chars. It's not like the code for this in pg_standby.c is terribly complex. The virtue of a perl script is that it's very easily customizable, e.g. you might only delete files if they are older than a certain age. cheers andrew