]> git.8kb.co.uk Git - pgpool-ii/pgpool-ii_2.2.5/blob - sample/pgpool_recovery_pitr
Attempt to send a proper failure message to frontend when authentication
[pgpool-ii/pgpool-ii_2.2.5] / sample / pgpool_recovery_pitr
1 #! /bin/sh
2 # Online recovery 2nd stage script
3 #
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
8
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|
11 while read i
12 do
13   if [ "$i" != "" ];then
14     psql -p $port -c "SELECT setval(oid, nextval(oid)) FROM pg_class WHERE relkind = 'S'" $i
15   fi
16 done
17
18 psql -p $port -c 'SELECT pg_switch_xlog()' postgres