resume.sh
application/octet-stream
Filename: resume.sh
Type: application/octet-stream
Part: 0
:
#
# for testing
set -x
#PGDATA=/home/postgres/master/data # データ格納DIR
PGDATA=/home/postgres/patch/data # データ格納DIR
EXIT="exit 0"
if [ "$1" = "resume" ]; then
psql -c "SELECT pg_wal_replay_resume();" postgres
date +%Y/%m/%d_%H:%M:%S.%3N
pg_ctl promote -D ${PGDATA}
set +x
date +%Y/%m/%d_%H:%M:%S.%3N
while [ 1 ]
do
RS=`psql -Atc "select pg_is_in_recovery();" postgres`
if [ ${RS} = "f" ]; then
break
fi
done
date +%Y/%m/%d_%H:%M:%S.%3N
set -x
${EXIT}
fi