gpt4 book ai didi

postgresql - 在 PostgreSQL 上创建 unaccent 扩展时出错

转载 作者:行者123 更新时间:2023-11-29 11:06:56 25 4
gpt4 key购买 nike

我正在尝试将 PostgreSQL 配置为在我的 Rails 应用程序中使用全文搜索,如本 Railscast 中所述.

我正在使用新的 Ubuntu 12.04 服务器运行 PostgreSQL 9.1.5 使用 apt-getppa:pitti 安装/postgresqlprecise

尝试运行迁移时以及在 psql 控制台中与对等 postgres 用户尝试相同的命令时出现以下错误:

postgres=# CREATE EXTENSION unaccent;

ERROR: could not open extension control file "/usr/share/postgresql/9.1/extension/unaccent.control":
No such file or directory

在我运行 Ubuntu 10.04 桌面 的本地机器中,我使用相同的存储库 (natty),它运行良好。

如有任何见解,我们将不胜感激。

最佳答案

您需要先在系统中安装软件包 postgresql-contrib-9.1。 (适应你的版本号!这里是currently available list of packages.)无论如何在DebianUbuntu 和 friend 下都是这样。使用具有必要权限的系统用户:

apt-get install postgresql-contrib-9.1

如果您当前登录的用户没有必要的权限(但 sudo 权限):

sudo apt-get install postgresql-contrib-9.1

引用PostgreSQL Apt Repository :

If the version included in your version of Debian is not the one you want, you can use the PostgreSQL Apt Repository.

basic install instructions on the Postgres website对于每个可用的操作系统。

对于使用 unaccent 的重音不敏感索引,请考虑以下相关问题:

关于postgresql - 在 PostgreSQL 上创建 unaccent 扩展时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12100638/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com