Fix multiple bugs in PostgreSQL hook #677
|
@ -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 = (
|
||||||
jirutka marked this conversation as resolved
|
|||||||
('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 ())
|
||||||
witten
commented
The addition of The addition of `--no-psqlrc` sounds more correct, but I do worry a little that someone will be relying on their `~/.psqlrc` to be read. I guess we'll find out.
jirutka
commented
This is not a hypothetical situation, it happened to me… borgmatic failed because I have This is not a hypothetical situation, it happened to me… borgmatic failed because I have `\pset linestyle unicode` and `\pset border 2` in `.psqlrc`.
|
|||||||
+ (('--username', database['username']) if 'username' in database else ())
|
+ (('--username', database['username']) if 'username' in database else ())
|
||||||
|
|
Loading…
Reference in New Issue
Block a user
Nice.. I didn't know about
shlex.split()
!