Jeff Frost wrote:
On Sun, 2 Oct 2005, Simon Riggs wrote:

Probably the best idea is to backup the last WAL file for each timeline
seen. Keep track of that, so when the current file changes you'll know
which timeline you're on and stick to that from then on. Or more simply,
put some notes with your program saying "if you ever use a complex
recovery situation, make sure to clear all archive_status files for
higher timeline ids before using this program".
Tell me if you think this is the most reasonable way to determine the in
use WAL file:

ls -rt $PGDATA/pg_xlog/ | grep -v "backup\|archive\|RECOVERY" | tail -1
Look at this post I did last year:

in that messages there are two script that deliver remotelly the
archive wall, and they store too last WAL in order to not loose the
current WAL in case of crash.

This was the function I used to find the WAL in use:

function copy_last_wal
FILE=$( ls -t1p $PGXLOG | grep -v / | head -1 )

echo "Last Wal> " $FILE

cp ${PGXLOG}/${FILE} ${PARTIAL}/${FILE}.tmp
mv ${PARTIAL}/${FILE}.tmp ${PARTIAL}/${FILE}.partial
find ${PARTIAL} -name *.partial | grep -v ${FILE} | xargs -i rm -fr {}

At that time Tom Lane agreed to provide some functions to ask the engine
the name of WAL currently in use, dunno if in the new 8.1 something was
done in order to help this process.

Gaetano Mendola

Search Discussions

Discussion Posts


Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 14 of 18 | next ›
Discussion Overview
grouppgsql-admin @
postedNov 15, '03 at 4:26a
activeOct 15, '05 at 5:28p



site design / logo © 2022 Grokbase