Fix postgresql drop restore for a single db dump
This commit is contained in:
@@ -387,7 +387,7 @@ if [ -z "$found" ]; then
|
||||
echo "Cannot connect to the database: $_output";
|
||||
exit 1;
|
||||
fi;
|
||||
if [ ${DRY_RUN} ]; then
|
||||
if [ $DRY_RUN -eq 1 ]; then
|
||||
echo "**** [DRY RUN] ****";
|
||||
fi;
|
||||
echo "Will drop database '$database' on host '$_host:$_port' and load file '$file' with user '$owner', set encoding '$encoding' and use database version '$ident'";
|
||||
@@ -411,9 +411,9 @@ else
|
||||
_PG_PARAMS=("${PG_PARAMS[@]}");
|
||||
_PG_PARAMS+=("-U" "postgres" "${database}");
|
||||
if [ $DRY_RUN -eq 0 ]; then
|
||||
"${PG_DROPDB}" "${PG_PARAMS[@]}";
|
||||
"${PG_DROPDB}" "${_PG_PARAMS[@]}";
|
||||
else
|
||||
echo "${PG_DROPDB} ${PG_PARAMS[*]}";
|
||||
echo "${PG_DROPDB} ${_PG_PARAMS[*]}";
|
||||
fi;
|
||||
# CREATE DATABASE
|
||||
echo "Create DB $database with $owner and encoding $encoding on [$_host:$_port] @ $(date +"%F %T")";
|
||||
|
||||
Reference in New Issue
Block a user