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)