Sha256: d00f7bcadf693699f817a7e4849a773b2e53dca8d72650d1172cb554b5944262

Contents?: true

Size: 1.03 KB

Versions: 12

Compression:

Stored size: 1.03 KB

Contents

#! /bin/sh
# Force to flush current value of sequences to xlog

master_dir=$1
dest_host=$2
dest_dir=$3

source /etc/pgpool-II/config_for_script

log=$PGPOOL_LOG_DIR/recovery.log

if [ $dest_host = $NODE0_HOST ]; then
  master_host=$NODE1_HOST
  master_port=$NODE1_PORT

elif [ $dest_host = $NODE1_HOST ]; then
  master_host=$NODE0_HOST
  master_port=$NODE0_PORT

else
  exit 1
fi

function doSQL()
{
    local _DB=$1
    local _SQL=$2

    $psql -p $master_port -U $PGSUPERUSER -d $_DB -t -c "$_SQL"
}

echo "----------------------------------------------------------------------" >> $log
date >> $log
echo "----------------------------------------------------------------------" >> $log
echo "" >> $log

# Get dbnames
doSQL template1 'SELECT datname FROM pg_database WHERE NOT datistemplate AND datallowconn'

# Force to flush current value of sequences to xlog
while read i
do
  if [ "$i" != "" ]; then
    doSQL $i "SELECT setval(oid, nextval(oid)) FROM pg_class WHERE relkind = 'S'"
  fi
done
doSQL template1 "SELECT pgpool_switch_xlog('$ARCHIVE_DIR')"

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
prestogres-0.4.8 pgpool2/redhat/rpm_installer/pgpool_recovery_pitr
prestogres-0.4.7 pgpool2/redhat/rpm_installer/pgpool_recovery_pitr
prestogres-0.4.6 pgpool2/redhat/rpm_installer/pgpool_recovery_pitr
prestogres-0.4.5 pgpool2/redhat/rpm_installer/pgpool_recovery_pitr
prestogres-0.4.4 pgpool2/redhat/rpm_installer/pgpool_recovery_pitr
prestogres-0.4.3 pgpool2/redhat/rpm_installer/pgpool_recovery_pitr
prestogres-0.4.2 pgpool2/redhat/rpm_installer/pgpool_recovery_pitr
prestogres-0.4.1 pgpool2/redhat/rpm_installer/pgpool_recovery_pitr
prestogres-0.4.0 pgpool2/redhat/rpm_installer/pgpool_recovery_pitr
prestogres-0.3.0 pgpool2/redhat/rpm_installer/pgpool_recovery_pitr
prestogres-0.2.0 pgpool2/redhat/rpm_installer/pgpool_recovery_pitr
prestogres-0.1.0 pgpool2/redhat/rpm_installer/pgpool_recovery_pitr