Merge pull request #1023 from lorin/postgres-user-fix

Fix postgresql_user bug
This commit is contained in:
Michael DeHaan 2012-09-08 05:23:29 -07:00
commit 386c1d83b5

View file

@ -115,6 +115,8 @@ def get_database_privileges(cursor, user, db):
query = 'SELECT datacl FROM pg_database WHERE datname = %s'
cursor.execute(query, (db,))
datacl = cursor.fetchone()[0]
if datacl is None:
return []
r = re.search('%s=(C?T?c?)/[a-z]+\,?' % user, datacl)
if r is None:
return []