How do I install PostgreSQL-contrib-9.3 on Mac OSX?

I am trying to get PostgresSQL running on my MacOSX 10.9.4.

I have successfully installed PostgresSQL myself using Homebrew by following these instructions: https://www.codefellows.org/blog/how-to-install-postgresql . This is and I can connect to it using the command psql

.

However, when I try to create a postgis extension, it fails (see below). I understand what I need to install postgresql-contrib-9.3

.

$ psql -d mydb
psql (9.3.5)
Type "help" for help.

mydb=# CREATE EXTENSION postgis;
ERROR:  could not open extension control file "/usr/local/Cellar/postgresql/9.3.5/share/postgresql/extension/postgis.control": No such file or directory

      

How do I install this one postgresql-contrib-9.3

on Mac OSX? I have not apt-get

. The instructions I have seen are not entirely clear on how to install it. Can anyone consult?

+3


source to share


2 answers


I found the answer here: http://postgis.net/install :



$ brew install postgis
<SNIP SNIP>

$ psql -d mydb
psql (9.3.5)
Type "help" for help.

dbname=# CREATE EXTENSION postgis;
CREATE EXTENSION

      

+5


source


As of postgresql 9.4, Contrib seems to be included in the standard install. I was able to set the cube and earth resistance like

PGUSER=postgres psql my-db
create extension cube;
create extension earthdistance;

      



from the default macports installation postgresql94-server.

+1


source







All Articles