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
1 changed files with 3 additions and 3 deletions
Showing only changes of commit f0f43174c6 - Show all commits

View File

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