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

Merge branch 'fix_postgresql_db' of https://github.com/yteraoka/ansible into yteraoka-fix_postgresql_db

This commit is contained in:
James Cammarata 2013-09-06 13:26:01 -05:00
commit 71bf9495ef

View file

@ -130,10 +130,10 @@ def get_encoding_id(cursor, encoding):
def get_db_info(cursor, db):
query = """
SELECT usename AS owner,
SELECT rolname AS owner,
pg_encoding_to_char(encoding) AS encoding, encoding AS encoding_id,
datcollate AS lc_collate, datctype AS lc_ctype
FROM pg_database JOIN pg_user ON pg_user.usesysid = pg_database.datdba
FROM pg_database JOIN pg_roles ON pg_roles.oid = pg_database.datdba
WHERE datname = %(db)s
"""
cursor.execute(query, {'db':db})