On Fri, Feb 26, 2010 at 2:34 AM, Josh Berkus <josh@agliodbs.com> wrote:
>
>>> If you're adventurous enough, it's actually possible to set an
>>> archive_command that checks the status of the standby and returns
>>> failure as long as the standby still needs the given WAL segment. That
>>> way the primary doesn't recycle segments that are still needed by the
>>> standby, and you can get away without restore_command in the standby.
>
> I'd prefer something a little different ... is there any way to tell
> which log segments a standby still needs, *from* the standby?
pg_controldata can tell that. The log segment containing the "Latest
checkpoint's REDO location" that pg_controldata reports is the oldest
one still required for the standby. So we can remove the older log
segments than it from the archive.
Regards,
--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center