【发布时间】:2014-07-06 18:01:41
【问题描述】:
我刚刚使用最新版本的KyngChaos libraries 在 OSX Mavericks 上安装了 Postgres 9.3.4 和 PostGIS 2.1。
但是,当我尝试在数据库上创建空间扩展时,我不能,因为 Postgres 声称无法看到扩展文件:
:~ anna$ psql -d land -c "CREATE EXTENSION postgis;"
ERROR: could not open extension control file
"/usr/local/Cellar/postgresql/9.3.4/share/postgresql/extension/postgis.control":
No such file or directory
文件看起来好像位于其他地方:
:~ anna$ mdfind postgis.control
/usr/local/pgsql-9.3/share/extension/postgis.control
我肯定在使用预期版本的 Postgres,虽然我不知道这是否是 KyngChaos 库通常安装到的位置:
Annas-MacBook-Air:~ anna$ psql --version
psql (PostgreSQL) 9.3.4
Annas-MacBook-Air:~ anna$ which psql
/usr/local/pgsql-9.3/bin/psql
我一直非常小心不要使用 Homebrew 等安装 Postgres,因为我知道它可能会导致同一系统的多个版本出现问题。
谁能告诉我为什么扩展文件不在预期的位置?
更新:
看起来我的系统上可能存在多个版本的 Postgres,而我使用了错误的版本?
:~ anna$ mdfind -name "postgres" | grep -G "postgres$"
/usr/local/pgsql-9.3/bin/postgres
/usr/local/var/postgres
/usr/local/Cellar/postgresql/9.3.4/bin/postgres
我应该使用哪一个,如何设置系统默认使用这个?
进一步更新
这是pg_config的输出:
BINDIR = /usr/local/pgsql-9.3/bin
DOCDIR = /usr/local/pgsql-9.3/share/doc
INCLUDEDIR = /usr/local/pgsql-9.3/include
PKGINCLUDEDIR = /usr/local/pgsql-9.3/include
INCLUDEDIR-SERVER = /usr/local/pgsql-9.3/include/server
LIBDIR = /usr/local/pgsql-9.3/lib
PKGLIBDIR = /usr/local/pgsql-9.3/lib
LOCALEDIR =
MANDIR = /usr/local/pgsql-9.3/man
SHAREDIR = /usr/local/pgsql-9.3/share
SYSCONFDIR = /usr/local/pgsql-9.3/etc
PGXS = /usr/local/pgsql-9.3/lib/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--with-openssl' '--with-pam' '--with-krb5' '--with-gssapi' '--with-ldap' '--enable-thread-safety' '--with-bonjour' '--with-python' '--without-perl' '--enable-nls' '--with-libxml' 'CC=clang' 'CXX=clang++' 'CFLAGS=-Os -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.7.sdk -D_FILE_OFFSET_BITS=64' 'LD=clang' 'LDLFAGS=-arch x86_64 -isysroot /Developer/SDKs/MacOSX10.7.sdk'
CC = gcc
CPPFLAGS = -I/usr/include/libxml2
CFLAGS = -Os -arch x86_64 -D_FILE_OFFSET_BITS=64 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -fwrapv
CFLAGS_SL =
LDFLAGS = -arch x86_64 -Wl,-dead_strip_dylibs
LDFLAGS_SL =
LIBS = -lintl -liconv -lxml2 -lpam -lssl -lcrypto -lgssapi_krb5 -ledit -lz
VERSION = PostgreSQL 9.3.4
【问题讨论】:
-
安装的根目录不一样好像很奇怪。毕竟 postGIS 是 postgreSQL 的“扩展”。
-
嘿,@Richard 我想知道,您是否发现任何有用的答案?
标签: postgresql postgis geodjango