From efa23951a127070f204a2ac527358ec70b97d99f Mon Sep 17 00:00:00 2001 From: Ian Ballou Date: Wed, 24 Jul 2024 14:19:06 +0000 Subject: [PATCH] Use --file and --format with pg_dump --- lib/foreman_maintain/concerns/base_database.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/foreman_maintain/concerns/base_database.rb b/lib/foreman_maintain/concerns/base_database.rb index f6aff6979..1fe46bde0 100644 --- a/lib/foreman_maintain/concerns/base_database.rb +++ b/lib/foreman_maintain/concerns/base_database.rb @@ -73,7 +73,7 @@ def ping(config = configuration) end def dump_db(file, config = configuration) - execute!(dump_command(config) + " > #{file}", :hidden_patterns => [config['password']], :user => config['user']) + execute!(dump_command(config) + " -f #{file}", :hidden_patterns => [config['password']], :user => config['user']) end def restore_dump(file, localdb, config = configuration) @@ -169,9 +169,9 @@ def psql_command(config) def dump_command(config) if config['connection_string'] - "pg_dump -Fc #{config['connection_string']}" + "pg_dump --format=c #{config['connection_string']}" else - base_command(config, 'pg_dump') + " -Fc #{config['database']}" + base_command(config, 'pg_dump') + " --format=c #{config['database']}" end end