【发布时间】:2014-03-21 11:47:15
【问题描述】:
首先,这可能看起来像:
postgres hstore exists and doesn't exist at same time
但事实并非如此。虽然我在这种情况下收到相同的错误消息。在查看数据库上是否安装了 hstore 时,我们可以看到它是:
./psql -d photographerio_development -c '\dx'
List of installed extensions
Name | Version | Schema | Description
---------+---------+------------+--------------------------------------------------
hstore | 1.2 | hstore | data type for storing sets of (key, value) pairs
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
它也在 template_1 DB 上。
所以,当我尝试运行迁移以添加 hstore 时,我得到了 PG::Error: ERROR: extension "hstore" already exists,当我注释掉这个迁移时,在下一个需要 hstore 的迁移中,它显示 PG::UndefinedObject: ERROR: type "hstore" does not exist 这有点一个悖论。
这是一个带有 postgresql 9 的 Rails 4.0.1 应用程序,我让 hstore 在这台机器上运行其他几个项目。
【问题讨论】:
标签: ruby-on-rails postgresql hstore