postgresql - PostGIS Homebrew 安装引用旧路径?

标签 postgresql postgis homebrew

我在 OS X Mountain Lion 上升级并随后重新安装了 PostGIS 和 PostgreSQL。尝试使用 PostGIS 扩展时,我收到以下错误:

ERROR: could not open extension control file "/usr/local/Cellar/postgresql/
9.2.3/share/postgresql/extension/postgis.control": No such file or directory

看来 PostGIS(还有 PostgreSQL??)仍在 /postgresql/9.2.3/ 目录中寻找所需的文件,而不是在 /postgresql/9.2 中.4/ 目录。我已经使用 Homebrew 通过以下命令删除了所有以前版本的 PostgreSQL:

brew remove --force postgresql

有人可以指出正确的方向来说明为什么会出现这个问题吗? (某处一定有挥之不去的配置文件?)

任何帮助将不胜感激。

最佳答案

问题是您有一个运行在 9.2.3 版代码库上的 psql 服务器。要对此进行测试,请加载一个 psql 控制台,您应该会在顶部看到:

psql (9.2.4, server 9.2.3)
Type "help" for help.

请注意上面的“server 9.2.3”评论。如果您运行的是正确版本的服务器,您会看到:

psql (9.2.4)
Type "help" for help.

要解决此问题,只需按照 brew info postgresql 给出的卸载和加载 LaunchAgent 的说明进行操作 - 这将使用新代码重新启动服务器:

To reload postgresql after an upgrade:
    launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
    launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

关于postgresql - PostGIS Homebrew 安装引用旧路径?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16264973/

相关文章:

python - psycopg2 映射 Python : "list of dicts" to Postgres : "array of composite type" for an INSERT statement

ST_GeomFromText 的 postgresql 查询不起作用

php - PostGIS 函数集成在 php 示例中?

macos - 在 mac os x 中找不到 boost header 问题

postgresql - Osm2pgsql 由于错误 : PBF error: invalid BlobHeader size (> max_blob_header_size) 而失败

postgresql - 如何获得搜索多个术语以使用索引的 hstore 查询?

sql - 如何在sql中查询每个项目的最近五笔交易

postgresql - 从 plpython/Postgis 返回 SETOF 点

macos - 在 OS X 上安装黄金链接器

node.js - 用 Homebrew 软件更新我的 Node js 版本