【发布时间】:2015-10-01 16:14:10
【问题描述】:
当我尝试安装 unaccent Postgres 扩展(通过 postgresql-contrib 包)时,一切正常如下:
# psql -U postgres -W -h localhost
Password for user postgres:
psql (9.3.9)
SSL connection (cipher: DHE-RSA-AES256-GCM-SHA384, bits: 256)
Type "help" for help.
postgres=# CREATE EXTENSION unaccent;
CREATE EXTENSION
postgres=# SELECT unaccent('Hélène');
unaccent
----------
Helene
(1 row)
但是,当我尝试使用 Django 1.8 时,出现以下错误:
ProgrammingError: function unaccent(character varying) does not exist
LINE 1: ...able" WHERE ("my_table"."live" = true AND UNACCENT("...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
使用 Postgresql 9.3 和 Django 1.8。
【问题讨论】:
标签: django postgresql django-models