From d8bd9cc87be8f00e0f35949b354949c81b4b20ae Mon Sep 17 00:00:00 2001 From: Emmanuel Cazenave Date: Fri, 1 Mar 2019 12:30:50 +0100 Subject: [PATCH] enable pyscopg2 unicode type caster (#30752) Facilitate SELECT query with a WHERE clause on a varchar column. --- wcs_olap/feeder.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wcs_olap/feeder.py b/wcs_olap/feeder.py index 50d6652..e409c42 100644 --- a/wcs_olap/feeder.py +++ b/wcs_olap/feeder.py @@ -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: