From a55cef3cba43ae1a9c84e792db84e64eff7ab1d2 Mon Sep 17 00:00:00 2001 From: Aleksandr Vinokurov Date: Thu, 17 Aug 2017 18:40:24 +0200 Subject: [PATCH] Fix `postgresql_user` module to treat quoted identifier well, Fixes #18937 (#18938) --- lib/ansible/modules/database/postgresql/postgresql_user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/database/postgresql/postgresql_user.py b/lib/ansible/modules/database/postgresql/postgresql_user.py index d3aa671b8f..5993f9f5ba 100644 --- a/lib/ansible/modules/database/postgresql/postgresql_user.py +++ b/lib/ansible/modules/database/postgresql/postgresql_user.py @@ -499,7 +499,7 @@ def get_database_privileges(cursor, user, db): datacl = cursor.fetchone()[0] if datacl is None: return set() - r = re.search('%s=(C?T?c?)/[a-z]+\,?' % user, datacl) + r = re.search('%s\\\\?\"?=(C?T?c?)/[^,]+\,?' % user, datacl) if r is None: return set() o = set()