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

postgresql_privs: fix wrong codec specification

Use psycopg2's mapping from PostgreSQL encoding names to Python codec names.
This commit is contained in:
Bernhard Weitzhofer 2013-05-03 21:31:20 +02:00
parent c3547a2308
commit 119f33ed34

View file

@ -224,6 +224,7 @@ postgresql_privs: >
try:
import psycopg2
import psycopg2.extensions
except ImportError:
psycopg2 = None
@ -266,7 +267,8 @@ class Connection(object):
@property
def encoding(self):
return self.connection.encoding
"""Connection encoding in Python-compatible form"""
return psycopg2.extensions.encodings[self.connection.encoding]
### Methods for querying database objects