trex
trex

Reputation: 325

How to install PostgreSQL-contrib-9.3 on Mac OSX?

I'm trying to get PostgreSQL up and running on my MacOSX 10.9.4.

I successfully installed PostgreSQL itself using Homebrew by following the instructions listed here: https://www.codefellows.org/blog/how-to-install-postgresql. It's up and I can connect to it using the psql command.

However, when I try to create the postgis extension, it fails (see below). I understand 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 can I install this postgresql-contrib-9.3 on Mac OSX? I don't have apt-get. The instructions I have seen are not at all clear how to install it. Can someone please advise?

Upvotes: 7

Views: 14361

Answers (2)

kometen
kometen

Reputation: 7802

On postgresql 9.4 contrib seems to be a part of the default installation. I was able to install cube and earthdistance like

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

from a default macports postgresql94-server installation.

Upvotes: 3

trex
trex

Reputation: 325

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

Upvotes: 10

Related Questions