PostGIS Installation – How to Install PostGIS Extension to PostgreSQL with Stack Builder

installationmacpostgispostgresqlstackbuilder

I am trying to add the PostGIS extension to PostgreSQL. My efforts to add it to my existing Postgres application failed, so I uninstalled and reinstalled it.

I used the EDB installer. Everything went fine with the install until I tried to add the PostGIS extension in Stack Builder. It was then that I got this error:

It was not possible to perform the
installation with administrator privileges
(status: 4294907289).
Please execute:
sudo/tmp/h6trHS/postgis-pg13-3.0.2-1.
osx.app/Contents/MacOS/osx-x86_64 —
mode text
as an alternative to achieve the
same effect

I tried entering that command into terminal and got the following response:

zsh: no such file or directory: sudo/tmp/h6trHS/postgis-pg13-3.0.2-1.
zsh: no such file or directory: osx.app/Contents/MacOS/osx-x86_64

I've uninstalled PostgreSQL and reinstalled it multiple times. I've tried downloading different versions of it (weirdly the 14.1 install failed every time I tried, so this is with 13.5), but that didn't work either.

Does anyone know how to fix?

I am nearly coding-illiterate.

My computer is a Macbook Pro.

Best Answer

Follow the instructions on the PostGIS website to download and install PostGIS for macosx. https://postgis.net/install/

OSX

A popular distribution particularly for newbies is Postgres.app. It includes generally latest version of PostgreSQL, PostGIS, and PLV8. Great for development and testing. Do not mix with other installations. Homebrew users can just run “brew install postgis” and tends to be a favorite for more advanced users since there are brew scripts for most of the popular PostgreSQL extensions, not always present in other Mac distributions.

The EnterpriseDb OSX PostgreSQL combination from EnterpriseDB includes generally latest stable minor version of PostGIS.

The builds from KyngChaos are a little dated but useful for older PostGIS versions. Read the instructions carefully. Do not mix with other installations.