postgres - detect readonly instance
Compare changes
+ 52
− 28
@@ -42,6 +42,21 @@ function pgsql.backup(){
@@ -42,6 +42,21 @@ function pgsql.backup(){
@@ -52,38 +67,47 @@ function pgsql.backup(){
@@ -52,38 +67,47 @@ function pgsql.backup(){
sSqlGetDblist="select datname from pg_database where not datistemplate and datallowconn order by datname;"
for DATABASE in $( su ${PGUSER} -c "psql ${BACKUP_PARAMS} -At -c '$sSqlGetDblist' postgres" 2>/dev/null | grep -v "^$snapshotprefix" )
su ${PGUSER} -c "psql ${BACKUP_PARAMS} -c \"CREATE DATABASE ${SNAPSHOTDB} WITH TEMPLATE ${DATABASE};\"" >/dev/null