diff --git a/sql-recovery/recovery.py b/sql-recovery/recovery.py index 55488aa..05a2722 100755 --- a/sql-recovery/recovery.py +++ b/sql-recovery/recovery.py @@ -548,7 +548,7 @@ def error(error_no): # Filter - Remove actions on the root (postgres) user, which will otherwise # cause the recovery to fail with "current user cannot be dropped". # We only need to do this if the recovery is from a dumpall. -if DATABASE: +if not DATABASE: TARGET_FILE = "%s/%s.sql" % (RECOVERY_ROOT_DIR, DECOMPRESSED_RECOVERY_NAME) FILTER_PG_CMD = "egrep -v '^(CREATE|DROP) ROLE %s;' %s > filtered.sql ; mv filtered.sql %s" % (RECOVERY_DATABASE_ROOT_USER, TARGET_FILE, TARGET_FILE) print(" $", FILTER_PG_CMD)