diff options
| author | Jun Kuriyama <kuriyama@FreeBSD.org> | 2009-08-24 08:56:56 +0000 |
|---|---|---|
| committer | Jun Kuriyama <kuriyama@FreeBSD.org> | 2009-08-24 08:56:56 +0000 |
| commit | d97eea7b12488e0dcce06b5461a0bf3953e8648c (patch) | |
| tree | 1069013f6d47bcbc0f5f4e0208c1f6b4b5a9f8c5 /databases/pgpool-II/files/pgpool_switch_xlog | |
| parent | - Update to 1.30 (diff) | |
- Upgrade to 2.2.4.
- Add my scripts in $FILES dir, but not installed (no warranty).
Diffstat (limited to 'databases/pgpool-II/files/pgpool_switch_xlog')
| -rw-r--r-- | databases/pgpool-II/files/pgpool_switch_xlog | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/databases/pgpool-II/files/pgpool_switch_xlog b/databases/pgpool-II/files/pgpool_switch_xlog new file mode 100644 index 000000000000..8ce8b8603a46 --- /dev/null +++ b/databases/pgpool-II/files/pgpool_switch_xlog @@ -0,0 +1,20 @@ +#!/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 |
