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。