Merge "Malformed user access sql for postgres guest agent"

This commit is contained in:
Jenkins 2016-03-08 17:35:31 +00:00 committed by Gerrit Code Review
commit ffcc149891

View File

@ -212,7 +212,7 @@ class UserQuery(object):
def update_name(cls, old, new): def update_name(cls, old, new):
"""Query to update the name of a user.""" """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, old=old,
new=new, new=new,
) )
@ -231,7 +231,7 @@ class AccessQuery(object):
"""Query to list grants for a user.""" """Query to list grants for a user."""
return ( return (
"SELECT datname " "SELECT datname, pg_encoding_to_char(encoding), datcollate "
"FROM pg_database " "FROM pg_database "
"WHERE datistemplate = false " "WHERE datistemplate = false "
"AND 'user {user}=CTc' = ANY (datacl)".format(user=user) "AND 'user {user}=CTc' = ANY (datacl)".format(user=user)