Avoid logging passwords on user creation (#1370)

Fixes https://github.com/zalando/patroni/issues/1365
This commit is contained in:
Alexander Kukushkin
2020-01-24 10:52:23 +01:00
committed by GitHub
parent 16fe180ed6
commit 27ff9dfda3
+9 -1
View File
@@ -310,7 +310,15 @@ BEGIN
CREATE ROLE "{0}" WITH {1};
END IF;
END;$$""".format(name, ' '.join(options))
self._postgresql.query(sql, *params)
self._postgresql.query('SET log_statement TO none')
self._postgresql.query('SET log_min_duration_statement TO -1')
self._postgresql.query("SET log_min_error_statement TO 'log'")
try:
self._postgresql.query(sql, *params)
finally:
self._postgresql.query('RESET log_min_error_statement')
self._postgresql.query('RESET log_min_duration_statement')
self._postgresql.query('RESET log_statement')
def post_bootstrap(self, config, task):
try: