could not open extension control file “/usr/share/postgresql/9.1/extension/dblink.control“

转自:https://stackoverflow.com/questions/14541576/activerecordjdbcerror-error-could-not-open-extension-control-file

 

<span style="color:var(--highlight-color)"><code><span style="color:var(--highlight-comment)">-- execute("CREATE EXTENSION IF NOT EXISTS dblink WITH SCHEMA public;")</span>
  [enrollments_shard_one]   (16.0ms)  <span style="color:var(--highlight-keyword)">CREATE</span> EXTENSION <span style="color:var(--highlight-keyword)">IF</span> <span style="color:var(--highlight-keyword)">NOT</span> <span style="color:var(--highlight-keyword)">EXISTS</span> dblink <span style="color:var(--highlight-keyword)">WITH</span> <span style="color:var(--highlight-keyword)">SCHEMA</span> <span style="color:var(--highlight-keyword)">public</span>;
ActiveRecord::JDBCError: ERROR: could not open extension control file "/usr/share/postgresql/9.1/extension/dblink.control": No such file or directory: <span style="color:var(--highlight-keyword)">CREATE</span> EXTENSION <span style="color:var(--highlight-keyword)">IF</span> <span style="color:var(--highlight-keyword)">NOT</span> <span style="color:var(--highlight-keyword)">EXISTS</span> dblink <span style="color:var(--highlight-keyword)">WITH</span> <span style="color:var(--highlight-keyword)">SCHEMA</span> <span style="color:var(--highlight-keyword)">public</span>;
==  AddDblinkToEnrollmentsShards: Switching connection back ===================
rake aborted!
An error has occurred, this and all later migrations canceled:

ActiveRecord::JDBCError: ERROR: could not open extension control file "/usr/share/postgresql/9.1/extension/dblink.control": No such file or directory: <span style="color:var(--highlight-keyword)">CREATE</span> EXTENSION <span style="color:var(--highlight-keyword)">IF</span> <span style="color:var(--highlight-keyword)">NOT</span> <span style="color:var(--highlight-keyword)">EXISTS</span> dblink <span style="color:var(--highlight-keyword)">WITH</span> <span style="color:var(--highlight-keyword)">SCHEMA</span> <span style="color:var(--highlight-keyword)">public</span>;
arjdbc/jdbc/RubyJdbcConnection.java:195:in `<span style="color:var(--highlight-keyword)">execute</span><span style="color:var(--highlight-variable)">'</span></code></span>

在CentOS上:

sudo yum install postgres*contrib

录数据库,运行: 

CREATE EXTENSION dblink;

对于安装了多个pg版本的实例,用户还需要通过指定版本来安装contrib软件包:

sudo apt-get install postgresql-contrib-9.1

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值