Skip to content

Commit 89859ae

Browse files
committed
Don't break socket connections for postgres
Also, use dict.get() for default values.
1 parent ee6a9c1 commit 89859ae

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

dbbackup/db/postgresql.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99

1010
def create_postgres_uri(self):
11-
host = self.settings.get("HOST") or "localhost"
12-
dbname = self.settings.get("NAME") or ""
11+
host = self.settings.get("HOST", "localhost")
12+
dbname = self.settings.get("NAME", "")
1313
user = quote(self.settings.get("USER") or "")
14-
password = self.settings.get("PASSWORD") or ""
14+
password = self.settings.get("PASSWORD", "")
1515
password = f":{quote(password)}" if password else ""
1616
if not user:
1717
password = ""

docs/changelog.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Changelog
44
Unreleased
55
----------
66

7-
* Nothing (yet)!
7+
* Empty string as HOST for postgres unix domain socket connection is now supported.
88

99
4.2.1 (2024-08-23)
1010
----------

0 commit comments

Comments
 (0)