使用SQLAlchemy和PostgreSQL的'Unicode'与'String'

And*_*ett 12 python postgresql unicode sqlalchemy python-2.x

我因为缺乏有关字符编码的知识而提前道歉.

我的问题是:使用SQLAlchemy(或反之亦然)在PostgreSQL中存储数据时,使用'Unicode'类型而不是'String'类型是否有任何固有的优点/缺点?如果是这样,你会介意详细说明吗?

sor*_*rin 5

在99.99%的情况下,使用Unicode,并尽可能使用Python 3,因为这会使您的生活更轻松。

  • 可以详细说明为什么吗? (6认同)