diff --git a/selfprivacy_api/backup/postgres.py b/selfprivacy_api/backup/postgres.py index 64d22cd..3dd99c5 100644 --- a/selfprivacy_api/backup/postgres.py +++ b/selfprivacy_api/backup/postgres.py @@ -25,11 +25,10 @@ class PostgresDumper: def restore_database(self, backup_file: str): restore_command = [ "pg_restore", - "--dbname=postgresql://{}@{}/{}".format( - self.user, self.socket_dir, self.db_name - ), + f"--dbname=postgresql://{self.user}@{self.socket_dir}", "--clean", "--create", + "--exit-on-error", backup_file, ] subprocess.run(restore_command, check=True)