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.
thanks @jordanmkoncz, this is the issue for my case as well. For others who may run into this in the future: if you are not sure whether your postgresql and postgis versions are compatible, don't directly do
brew install postgis
, this will always install the latest postgis with all the latest dependencies(can be checked here). It can cause you trouble later if you need to downgrade with all the dependencies installed.