在PostgreSQL上创建不存在的扩展时出错 [英] Error when creating unaccent extension on PostgreSQL
问题描述
我正在尝试配置PostgreSQL以在我的Rails应用程序中使用全文搜索,正如本 Railscast 。
我使用新鲜的 Ubuntu 12.04
服务器运行 PostgreSQL 9.1 .5
使用 apt-get
安装,使用 ppa:pitti / postgresql
使用精确
。
在尝试运行迁移时以及在psql控制台中尝试相同命令时出现以下错误与同行postgres用户:
postgres =#CREATE EXTENSION unaccent;
错误:无法打开扩展控制文件/ usr / share / postgresql / 9.1 / extension / unaccent.control:
没有这样的文件或目录
运行 Ubuntu 10.04桌面
我使用相同的存储库( natty
),它运行良好。
任何见解都将不胜感激。 您需要安装软件包 postgresql-contrib-9.1
。 (适应您的版本号!以下是当前可用的软件包列表。 ) Debian , Ubuntu &无论如何,朋友。使用具有必要权限的系统用户:
apt-get install postgresql-contrib-9.1
如果您当前登录的用户没有必要的权限(但 sudo
权限):
sudo apt-get install postgresql-contrib-9.1
引用 PostgreSQL Apt Repository
$ b
如果您的Debian版本中包含的版本不是您想要的
版本,您可以使用PostgreSQL Apt Repository。
对于使用 unaccent
I am trying to configure PostgreSQL to use fulltext search in my rails app as mentioned in this Railscast.
I am using a fresh Ubuntu 12.04
server running PostgreSQL 9.1.5
installed using apt-get
with the ppa:pitti/postgresql
with precise
.
I get the following error when trying to run the migration and when I try the same command in the psql console with the peer postgres user:
postgres=# CREATE EXTENSION unaccent;
ERROR: could not open extension control file "/usr/share/postgresql/9.1/extension/unaccent.control":
No such file or directory
In my local box running Ubuntu 10.04 desktop
I use the same repository (natty
) and it works well.
Any insights would be greatly appreciated.
You need to install the package postgresql-contrib-9.1
in your system first. (Adapt to your version number! Here is the currently available list of packages.) That's the case under Debian, Ubuntu & friends anyway. Using a system user with the necessary privileges:
apt-get install postgresql-contrib-9.1
If your currently logged in user does not have the necessary privileges (but sudo
rights):
sudo apt-get install postgresql-contrib-9.1
Quoting the 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.
There are basic install instructions on the Postgres website for each available OS.
For accent-insensitive indices using unaccent
consider this related question:
这篇关于在PostgreSQL上创建不存在的扩展时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!