Skip to content

Instantly share code, notes, and snippets.

@evolve2k
Last active December 18, 2017 00:00
Show Gist options
  • Save evolve2k/75e950ccf27f45f6a95e42e5bffe13ac to your computer and use it in GitHub Desktop.
Save evolve2k/75e950ccf27f45f6a95e42e5bffe13ac to your computer and use it in GitHub Desktop.

Definitive guide to getting Postgres Running on MacOS

Background

In 2012 I posted a question on Stackoverflow that has since had over 180,000 views. When postgres stops running it has always felt like vodoo arts to get it back online and to this day has felt like mindless googling until the issue hopefully resolved.

This guide aims to pull together all the common issues in one place and create a definitive guide and workflow to getting postgres up and running on your Mac.

Why this mess?

1. Apple comes with a system installed version of Postgres that is strange in a few ways.

Some conflicts arise from the Mac getting confused over which version of Postgres to use.

2. MacOS does not include a decent package manager

Replacement package managers, such as Homebrew do many things great to fill the missing package manager void, unfortunatley installing a database is administrativley intrusive on your Mac and is a little beyond the abilities of the package manager to fully get right. Your package manager is using hacks to get Postgres installed and often it just doesn't work out right. TLDR; MacOS needs a native package manager. Until then seek more reliable approaches.

3. Postgres.app is the simplist approach for most Devs.

PostgresApp has been created as a Mac App to address correctly installing postgres in a clean way beyond the scope of what Homebrew can do. TLDR; The most reliable way forward for non Postgres experts is to remove any Postgres versions you have installed and use Postgres App. Often this will be simple, but there are also traps here (which we will discuss below).

Our recommended (fool-proof) approach to getting Postgres running

  1. Use Postgress App to install and run Postgres
  2. If you have any non system versions of Postgres Installed, remove them first.
  3. If you run into common issues, this guide will show you how to address them.

Finally we're also open to new insights and ideas that will hopefully come from getting this guide out there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment