From 61d06b510a6ff779fd2a361220d12ee7b9851ac7 Mon Sep 17 00:00:00 2001 From: Alex Tomic Date: Fri, 2 Oct 2015 16:50:15 -0400 Subject: [PATCH] Malformed user access sql for postgres guest agent The postgresql guest agent creates a malformed sql statement when attempting to retrieve or modify the list of users with access to the DB. Change-Id: I87d3a71b4b567707561dd8110b3f80f8095f95bb Fixes-bug: 1543816 --- trove/guestagent/datastore/experimental/postgresql/pgutil.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trove/guestagent/datastore/experimental/postgresql/pgutil.py b/trove/guestagent/datastore/experimental/postgresql/pgutil.py index f32c414b6d..5ba364a443 100644 --- a/trove/guestagent/datastore/experimental/postgresql/pgutil.py +++ b/trove/guestagent/datastore/experimental/postgresql/pgutil.py @@ -212,7 +212,7 @@ class UserQuery(object): def update_name(cls, old, new): """Query to update the name of a user.""" - return "ALTER USER \"{old}\" RENAME TO '{new}'".format( + return "ALTER USER \"{old}\" RENAME TO \"{new}\"".format( old=old, new=new, ) @@ -231,7 +231,7 @@ class AccessQuery(object): """Query to list grants for a user.""" return ( - "SELECT datname " + "SELECT datname, pg_encoding_to_char(encoding), datcollate " "FROM pg_database " "WHERE datistemplate = false " "AND 'user {user}=CTc' = ANY (datacl)".format(user=user)