Sign up ×
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them, it only takes a minute:

In sqlalchemy, I use classical mapping and autoload=True. I want to query data which is jsontype from postgresql.

    D:\Python27\lib\site-packages\sqlalchemy\dialects\postgresql\base.py:1706: SAWarning:  Did not recognize type 'json' of column 'comm_media_alias'name, format_type, default, notnull, domains, enums, schema)

how to deal with this problem

share|improve this question

1 Answer 1

up vote 3 down vote accepted

The JSON type in PostgreSQL is a relatively new data type in PostgreSQL, and thus SQLAlchemy has only recently added functionality to properly detect it. At the time of this question, SQLAlchemy would not be able to detect the "JSON" column type, as doing so relied on functionality that it did not yet support.

SQLAlchemy 0.9 was released on December 30th, 2013. This version contains support for the PostgreSQL JSON data type, so I would recommend upgrading to this version and trying again.

If you can't upgrade (or the upgrade still isn't working for you), you can also change your column type to something else (like TEXT).

Another thing to note about this is that it is not an error: it is a warning. I'm not sure what SQLAlchemy will actually try to do when it is working with the column that is a JSON type, but it might end up working anyway.

share|improve this answer
    
I've updated my question as the SQLAlchemy 0.9 release adds support for JSON. – Mark Hildreth Dec 31 '13 at 18:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.