Re: restore_command %r option

From: "Steven Flatt" <steven(dot)flatt(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: restore_command %r option
Date: 2008-03-17 10:53:54
Message-ID: 357fa7590803170353s48b5cb2dob393c4bf3e842288@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(dot)flatt(at)gmail(dot)com>
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,
> Steve
>
> On Mon, Mar 10, 2008 at 11:32 AM, Steven Flatt <steven(dot)flatt(at)gmail(dot)com>
> 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
> >
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Daniel Verite 2008-03-17 11:54:21 Re: Updating
Previous Message Mr.Frog.to.you@googlemail.com 2008-03-17 08:27:14 Re: Using PL/R for predictive analysis of data.