加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

postgresql – OS X上的Postgres找不到postgis扩展控制文件

发布时间:2020-12-13 16:22:32 所属栏目:百科 来源:网络整理
导读:使用mac OSX Yosemite 10.10.1.我用自制软件卸载并重新安装了postgres和postgis.我知道postgres正在查找postgis控制文件的错误位置.还注意到’哪个psql’路径似乎不正确.我如何/在哪里解决这个问题? PSQL (9.4.0,server 9.3.5)ERROR: could not open extens
使用mac OSX Yosemite 10.10.1.我用自制软件卸载并重新安装了postgres和postgis.我知道postgres正在查找postgis控制文件的错误位置.还注意到’哪个psql’路径似乎不正确.我如何/在哪里解决这个问题?

PSQL

(9.4.0,server 9.3.5)

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

找到/ usr -name postgis.control

/usr/local/Cellar/postgresql/9.4.0/share/postgresql/extension/postgis.control

哪个psql

/usr/local/bin/psql

哪个pg_config

/usr/local/bin/pg_config

brew info postgis

postgis: stable 2.1.5,HEAD
http://postgis.net
/usr/local/Cellar/postgis/2.1.5 (45 files,8.6M) *
  Built from source
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/postgis.rb

brew info postgres

postgresql: stable 9.4.0 (bottled)
http://www.postgresql.org/
Conflicts with: postgres-xc
/usr/local/Cellar/postgresql/9.4.0 (3049 files,74M) *
  Poured from bottle
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/postgresql.rb

.bashrc和.bash_profile都有

export PGDATA='/usr/local/Cellar/postgresql/9.4.0/bin/postgres'
alias postgres-log='cd /usr/local/var/postgres/ && subl server.log'

mdfind -name“postgres”| grep -G“postgres $”

/usr/local/Cellar/postgresql/9.4.0/bin/postgres
/usr/local/var/postgres
/Users/lionelramos/macports/var/macports/sources/rsync.macports.org/release/tarballs/ports/ruby/rb-postgres

看起来除了自制软件版本之外,我还有不同的postgres本地版本.

我是如何解决我的问题的:

>我使用brew卸载postgres 9.3.5_1卸载了postgres 9.3.5_1.
>我用brew卸载postgis卸载了postgis
>确保我只使用brew信息postgres安装了postgres 9.4
>确保psql命令有效.
>我用brew install postgis重新安装了postgis.

这解决了我的问题.如果您遇到第4步的问题,则可能需要使用initdb或createdb命令来创建所需的数据库.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读