diff --git a/patroni/postgresql.py b/patroni/postgresql.py index 0e279402..5a6cb390 100644 --- a/patroni/postgresql.py +++ b/patroni/postgresql.py @@ -132,6 +132,8 @@ class Postgresql: if not self._connection or self._connection.closed != 0: r = parseurl('postgres://{}/postgres'.format(self.local_address)) r.update(self.superuser) + if r.get('username'): + r['user'] = r['username'] self._connection = psycopg2.connect(**r) self._connection.autocommit = True self.server_version = self._connection.server_version diff --git a/postgres1.yml b/postgres1.yml index a8802226..c2d84ea0 100644 --- a/postgres1.yml +++ b/postgres1.yml @@ -63,7 +63,7 @@ postgresql: password: rep-pass network: 127.0.0.1/32 superuser: - user: postgres + username: postgres password: zalando admin: username: admin diff --git a/postgres2.yml b/postgres2.yml index 99e8b47e..33620823 100644 --- a/postgres2.yml +++ b/postgres2.yml @@ -63,7 +63,7 @@ postgresql: password: rep-pass network: 127.0.0.1/32 superuser: - user: postgres + username: postgres password: zalando admin: username: admin