6
当我试图(通过postgresql-contrib
包)来安装unaccent
Postgres的扩展,一切正常按以下:怎样才能激活已经存在的模型unaccent扩展
# 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。