diff --git a/api/chalicelib/utils/pg_client.py b/api/chalicelib/utils/pg_client.py index 8da809418..b11ba4079 100644 --- a/api/chalicelib/utils/pg_client.py +++ b/api/chalicelib/utils/pg_client.py @@ -147,7 +147,8 @@ class PostgresClient: self.cursor.close() except Exception as error: logging.error("Error while closing cursor for recreation", error) - self.cursor = self.connection.cursor(cursor_factory=psycopg2.extras.RealDictCursor) + self.cursor = None + self.__enter__() def close():