1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

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
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"""
cursor.execute(query, {'db':db, 'user':user})
return cursor.rowcount == 1