So I had been using the "Time of latest checkpoint" value from pg_controldata, and freely deleting any archive files that were archived prior to this time, but it appears as though this is not safe since after restoring the ".backup" archive file at the start of recovery, I've accidentally deleted some (many) needed archive files.
The "Time of latest checkpoint" seemed to move to a date just prior to the time the ".backup" file was archived, which was at the end of a 63-hour file-system-backup of the primary server. Hence most files archived during the time of the base backup were immediately deleted, and now recovery is hanging waiting for a file that was just removed.
How else programmatically can I determine when it is safe to remove archive files? Do I need to look at the "Minimum recovery ending location"?
Your help is much appreciated.
Steve
On Mon, Mar 10, 2008 at 12:23 PM, Steven Flatt <steven.flatt@xxxxxxxxx> wrote:
Well, after some testing, it appears as though the %r option is not supported on 8.2.4.It also looks as though pg_controldata may have the answer I want, but what is the best programmatic way to determine the earliest archive file that I need to keep?Thanks,SteveOn Mon, Mar 10, 2008 at 11:32 AM, Steven Flatt <steven.flatt@xxxxxxxxx> wrote:
Is the %r option of the restore_command available in PG 8.2.4? If not, is there any other way to know how many archive files need to be kept on the standby server when in recovery mode?Thanks,Steve