For reference: http://postgis.net/install
The most reliable way to get PostGIS on OSX is to download and install Postgres.app. Great for development and testing. Do not mix with other installations. Select the extension when prompted.
You just need to add the extensions, Homebrew users can just run brew install postgis
-
Drop into your database
psql oneblock_development
-
Run the following commands to add the extensions.
-- Enable PostGIS (includes raster)
$ CREATE EXTENSION postgis;
If you get:
ERROR: 58P01: could not open extension control file "/usr/local/Cellar/postgresql/9.3.4/share/postgresql/extension/postgis.control": No such file or directory
you probably don’t have the extension installed correctly.
-- Enable Topology
$ CREATE EXTENSION postgis_topology;
-- fuzzy matching needed for Tiger
$ CREATE EXTENSION fuzzystrmatch;
-- Enable US Tiger Geocoder
$ CREATE EXTENSION postgis_tiger_geocoder;
Confirm that it worked:
$ SELECT POSTGIS_FULL_VERSION();
You should see a message including postgis_full_version
followed by a version number and some other info.
If, as you say, I don't have the extension installed correctly, how do I do so? I have just installed postgis using homebrew and am encountered the error mentioned after the command "$ CREATE EXTENSION postgis;" Installing it this way is not working.