Setting up Postgresql on mac

A short description of the post.

Rodney Dyer https://dyerlab.org (Center for Environmental Studies)https://ces.vcu.edu
2020-03-12

This is rather quick and easy to do. On MacOS, make sure you have Homebrew installed and then follow those instructions.

For me, it took a few additional steps because I was installing it on a new mac mini (in the home office). I had not made sure everything was up-to-date before starting so I had to walk away for a little bit to let it all happen. No biggie.

rodney@rodneys-mini ~ % brew install postgis
Error: The following formulae
  [#<Dependency: "python" []>, #<Options: []>] and [#<Dependency: "gcc" []>, #<Options: []>]
cannot be installed as binary packages and must be built from source.
Install the Command Line Tools:
  xcode-select --install

So I ran this to install the command line build tools:

rodney@rodneys-mini ~ % xcode-select --install
xcode-select: note: install requested for command line developer tools

This took several minutes as I had not updated my XCode in a while. No problem though. Then I went back and ran the command again, which installed a ton of dependencies.

rodney@rodneys-mini ~ % brew install postgis  
==> Installing dependencies for postgis: cfitsio, popt, epsilon, expat, freexl, gdbm, openssl@1.1, readline, sqlite, xz, python, geos, giflib, gmp, isl, mpfr, libmpc, gcc, szip, hdf5, jpeg, jasper, json-c, libxml2, libdap, libtiff, proj, libgeotiff, libpng, libpq, libspatialite, netcdf, openblas, numpy, pcre, freetype, fontconfig, libffi, glib, lzo, pixman, cairo, little-cms2, nspr, nss, openjpeg, qt, poppler, libtool, unixodbc, webp, xerces-c, zstd, gdal, icu4c, krb5, postgresql, protobuf, protobuf-c, boost, eigen, cgal and sfcgal

That took a while.

Citation

For attribution, please cite this work as

Dyer (2020, March 12). The Dyer Laboratory: Setting up Postgresql on mac. Retrieved from https://dyerlab.github.io/DLabWebsite/posts/2020-03-12-setting-up-postgresql-on-mac/

BibTeX citation

@misc{dyer2020setting,
  author = {Dyer, Rodney},
  title = {The Dyer Laboratory: Setting up Postgresql on mac},
  url = {https://dyerlab.github.io/DLabWebsite/posts/2020-03-12-setting-up-postgresql-on-mac/},
  year = {2020}
}