Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sql-recovery/recovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down