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

前端之家收集整理的这篇文章主要介绍了postgresql – OS X上的Postgres找不到postgis扩展控制文件前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
使用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命令来创建所需的数据库.

原文链接:https://www.f2er.com/postgresql/192367.html

猜你在找的Postgre SQL相关文章