I have installed PostGIS on the mac using the binaries available on http://www.kyngchaos.com/software:postgres
Postgres v 9.1.3
PostGIS v 2.0
After that I want to enable postgis for my database. I tried using CREATE EXTENSION query. But it error'ed out saying that the extension is not available. I then tried
sudo -u postgres psql -d [your database] -f /usr/local/pgsql/share/contrib/postgis-2.0/postgis.sql Password: SET BEGIN psql:/usr/local/pgsql/share/contrib/postgis-2.0/postgis.sql:69: ERROR: could not access file "$libdir/postgis-2.0": No such file or directory
How can i make $libdir expand into the path which i found by executing
$ pg_config --pkglibdir /usr/lib/postgresql
The /usr/lib/postgresql does NOT contain postgis-2.0.
Digging around for a few more hours I found a hacky solution:
This makes the pg_config magically change to:
$ pg_config --pkglibdir /usr/local/pgsql-9.1/lib
And then I hardcode that path into the postgis.sql file. But I want to know why $libdir doesnt resolve automatically.