From 0b938f31c8221105abee1bd4e6d910a890109ed6 Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Thu, 16 Oct 2025 16:06:46 +0900 Subject: [PATCH] Fix postgresql drop restore for a single db dump --- pg_drop_restore.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pg_drop_restore.sh b/pg_drop_restore.sh index e02c87e..e22d9fb 100755 --- a/pg_drop_restore.sh +++ b/pg_drop_restore.sh @@ -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")";