Fix PostgreSQL hook not using "psql_command" for list when dumping "all"

This commit is contained in:
Jakub Jirutka 2023-04-14 15:10:44 +02:00
parent 50b0a9ce38
commit 874fba7672

View file

@ -59,8 +59,9 @@ def database_names_to_dump(database, extra_environment, log_prefix, dry_run):
if dry_run: if dry_run:
return () return ()
psql_command = database.get('psql_command') or 'psql'
list_command = ( list_command = (
('psql', '--list', '--no-password', '--csv', '--tuples-only') (psql_command, '--list', '--no-password', '--csv', '--tuples-only')
+ (('--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 ())
+ (('--username', database['username']) if 'username' in database else ()) + (('--username', database['username']) if 'username' in database else ())