mirror of
https://github.com/beard7n/bsdports.git
synced 2026-04-10 10:31:20 +02:00
21 lines
494 B
Bash
21 lines
494 B
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD: head/databases/pgpool-II-33/files/pgpool_switch_xlog 340872 2014-01-24 00:14:07Z mat $
|
|
|
|
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
|