enable pyscopg2 unicode type caster (#30752)

Facilitate SELECT query with a WHERE clause
on a varchar column.
This commit is contained in:
Emmanuel Cazenave 2019-03-01 12:30:50 +01:00
parent 17bce30be9
commit d8bd9cc87b
1 changed files with 2 additions and 0 deletions

View File

@ -260,6 +260,8 @@ class WcsOlapFeeder(object):
self.connection = psycopg2.connect(dsn=pg_dsn)
self.connection.autocommit = True
self.cur = self.connection.cursor()
psycopg2.extensions.register_type(psycopg2.extensions.UNICODE, self.cur)
try:
self.has_jsonb = self.detect_jsonb()
if self.has_jsonb: