1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-19 08:13:21 +00:00
freebsd-ports/databases/pgpool-II-23/files/pgpool_switch_xlog
Jun Kuriyama d97eea7b12 - Upgrade to 2.2.4.
- Add my scripts in $FILES dir, but not installed (no warranty).
2009-08-24 08:56:56 +00:00

21 lines
407 B
Bash

#!/bin/sh
#
# $FreeBSD$
logger="logger -t pgpool -p local0.info"
psql=/usr/local/bin/psql
/bin/sh <<EOF | ${logger} 2>&1
$psql -t -c 'SELECT datname FROM pg_database WHERE NOT datistemplate AND datallowconn' template1 |
while read i
do
if [ "$i" != "" ];then
$psql -c "SELECT setval(oid, nextval(oid)) FROM pg_class WHERE relkind = 'S'" $i
fi
done
$psql -c 'select pg_switch_xlog()' template1
EOF