From fdaf65282b4cd7d76758bc6ed4f6feda270fedd0 Mon Sep 17 00:00:00 2001 From: Pepe Barbe Date: Wed, 22 Aug 2012 13:34:24 -0500 Subject: [PATCH] bugfix in sql query --- library/postgresql_db | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/postgresql_db b/library/postgresql_db index ca5e805318..32ee920590 100755 --- a/library/postgresql_db +++ b/library/postgresql_db @@ -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