We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ddf176c commit 8281c2cCopy full SHA for 8281c2c
1 file changed
sql-recovery/recovery.py
@@ -548,7 +548,7 @@ def error(error_no):
548
# Filter - Remove actions on the root (postgres) user, which will otherwise
549
# cause the recovery to fail with "current user cannot be dropped".
550
# We only need to do this if the recovery is from a dumpall.
551
-if DATABASE:
+if not DATABASE:
552
TARGET_FILE = "%s/%s.sql" % (RECOVERY_ROOT_DIR, DECOMPRESSED_RECOVERY_NAME)
553
FILTER_PG_CMD = "egrep -v '^(CREATE|DROP) ROLE %s;' %s > filtered.sql ; mv filtered.sql %s" % (RECOVERY_DATABASE_ROOT_USER, TARGET_FILE, TARGET_FILE)
554
print(" $", FILTER_PG_CMD)
0 commit comments