[Sqlalchemy-tickets] Issue #4358: Problem with psycopg2 >=2.5.4 and JSONB field (zzzeek/sqlalchemy)
Brought to you by:
zzzeek
From: Manuel H. <iss...@bi...> - 2018-11-02 09:16:09
|
New issue 4358: Problem with psycopg2 >=2.5.4 and JSONB field https://bitbucket.org/zzzeek/sqlalchemy/issues/4358/problem-with-psycopg2-254-and-jsonb-field Manuel Holtgrewe: When using psycopg2 >=2.5.4, JSONB fields are directly returned as Python objects and not as strings. This leads to a problem as SQLAlchemy tries to run `json.loads()` on these already decoded JSON files. Also see here: - https://stackoverflow.com/questions/50538699/sqlalchemy-psycopg2-jsonb-columns-are-being-returned-as-strings-instead-of-dict - http://initd.org/psycopg/docs/extras.html#json-adaptation I'm sorry that I do not have time to write a complete example showing the bug but I could work around it by disabling this behaviour in psycopg2 (as shown in the second link). |