2 # Online recovery 2nd stage script
4 datadir=$1 # master dabatase cluster
5 DEST=$2 # hostname of the DB node to be recovered
6 DESTDIR=$3 # database cluster of the DB node to be recovered
7 port=5432 # PostgreSQL port number
9 # Force to flush current value of sequences to xlog
10 psql -p $port -t -c 'SELECT datname FROM pg_database WHERE NOT datistemplate AND datallowconn' template1|
13 if [ "$i" != "" ];then
14 psql -p $port -c "SELECT setval(oid, nextval(oid)) FROM pg_class WHERE relkind = 'S'" $i
18 psql -p $port -c 'SELECT pg_switch_xlog()' postgres