bugfix in sql query

This commit is contained in:
Pepe Barbe 2012-08-22 13:34:24 -05:00
parent fdbc99dc28
commit fdaf65282b

View file

@ -33,7 +33,7 @@ def set_owner(cursor, db, owner):
return True return True
def db_owned_by(cursor, db, user): def db_owned_by(cursor, db, user):
query = """SELECT count(*) FROM pg_database JOIN pg_user ON datdba = usesysid query = """SELECT * FROM pg_database JOIN pg_user ON datdba = usesysid
WHERE usename = %(user)s and datname = %(db)s""" WHERE usename = %(user)s and datname = %(db)s"""
cursor.execute(query, {'db':db, 'user':user}) cursor.execute(query, {'db':db, 'user':user})
return cursor.rowcount == 1 return cursor.rowcount == 1