Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I've just installed Postgres 9.3.4 and PostGIS 2.1 on OSX Mavericks using the very latest versions of the KyngChaos libraries. This is a new machine, and I deliberately haven't installed Postgres using Homebrew or Macports.

However, when I try to create spatial extensions on a database, I can't, because Postgres claims not to be able to see the extension file:

:~ 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

It looks as though the file is located somewhere else:

:~ anna$ mdfind postgis.control
/usr/local/pgsql-9.3/share/extension/postgis.control

I'm definitely using the expected version of Postgres, although I don't know it's actually the Kyngchaos version:

:~ anna$ psql --version
psql (PostgreSQL) 9.3.4

:~ anna$ which psql
/usr/local/pgsql-9.3/bin/psql

It looks like perhaps there are multiple versions of Postgres floating around on my system, and I'm using the wrong one?

:~ 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

Can anyone advise me on what to do next?


FURTHER UPDATE

Here's the output of 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
share|improve this question
    
You've definitely got at least two versions there. Where did the Cellar one come from? That seems to be the one you are using from the error note in the create extension. How did you start up your postgresql service? –  LR1234567 May 19 at 1:14
    
Thanks. In the end the answer - as always with PostGIS installation questions, I find - was to uninstall all versions of Postgres / PostGIS from my machine, and start again from scratch. –  Richard May 20 at 22:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.