Fix multiple bugs in PostgreSQL hook #677

Merged
witten merged 6 commits from jirutka/borgmatic:fix-postgres-hook into main 2023-04-21 04:05:22 +00:00
2 changed files with 2 additions and 2 deletions
Showing only changes of commit dfccc1b94a - Show all commits

View File

@ -223,7 +223,7 @@ def restore_database_dump(database_config, log_prefix, location_config, dry_run,
+ (
('--if-exists', '--exit-on-error', '--clean', '--dbname', database['name'])
if not all_databases
else ('--no-psqlrc',)
else ('--no-psqlrc', '--set', 'ON_ERROR_STOP=on')
)
+ (('--host', database['hostname']) if 'hostname' in database else ())
+ (('--port', str(database['port'])) if 'port' in database else ())

View File

@ -607,7 +607,7 @@ def test_restore_database_dump_runs_psql_for_all_database_dump():
flexmock(module).should_receive('make_dump_path')
flexmock(module.dump).should_receive('make_database_dump_filename')
flexmock(module).should_receive('execute_command_with_processes').with_args(
('psql', '--no-password', '--no-psqlrc'),
('psql', '--no-password', '--no-psqlrc', '--set', 'ON_ERROR_STOP=on'),
processes=[extract_process],
output_log_level=logging.DEBUG,
input_file=extract_process.stdout,