postgresql_privs: fix wrong codec specification
Use psycopg2's mapping from PostgreSQL encoding names to Python codec names.
This commit is contained in:
parent
351bcf24cf
commit
d0d9ed5b9c
1 changed files with 3 additions and 1 deletions
|
@ -224,6 +224,7 @@ postgresql_privs: >
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import psycopg2
|
import psycopg2
|
||||||
|
import psycopg2.extensions
|
||||||
except ImportError:
|
except ImportError:
|
||||||
psycopg2 = None
|
psycopg2 = None
|
||||||
|
|
||||||
|
@ -266,7 +267,8 @@ class Connection(object):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def encoding(self):
|
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
|
### Methods for querying database objects
|
||||||
|
|
Loading…
Reference in a new issue