You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Martin Koehler 3df7dd3b4f Fixes for 3 days ago
Artwork Adding 3D model of the Elephant 2 years ago
Postgres Use cp -a to preserve symlinks 4 weeks ago
Postgres.xcodeproj Refactor build script 3 months ago
PostgresLoginHelper Use Variables for version numbers 2 years ago
PostgresMenuHelper Added NSAppleEventsUsageDescription key to Info.plist 2 months ago
buildscripts Fixes for 3 days ago
docs Release 2.3.3e 3 weeks ago
src-9.4 PostgreSQL 9.4.26, 9.5.21, 9.6.17, OpenSSL 1.0.2u 1 week ago
src-9.5 PostgreSQL 9.4.26, 9.5.21, 9.6.17, OpenSSL 1.0.2u 1 week ago
src-9.6 PostgreSQL 9.4.26, 9.5.21, 9.6.17, OpenSSL 1.0.2u 1 week ago
src-10 PostgreSQL 10.12, OpenSSL 1.0.2u, 1 week ago
src-11 PostgreSQL 11.7, GDAL 2.4.4, plv8 2.3.14 1 week ago
src-12 PostgreSQL 12.2, GDAL 3.0.4 1 week ago
.gitignore Update .gitignore 1 year ago
LICENSE Replacing license in source file headers to PostgreSQL License 7 years ago Update README 4 weeks ago

The easiest way to run PostgreSQL on your Mac

  • Includes everything you need to get started with PostgreSQL
  • Comes ith a pretty GUI to start / stop servers
  • Run Multiple Versions of PostgreSQL simultaneously


You can download recent versions of from the website.

Older versions and pre-releases are available in the releases section on GitHub.


Documentation is available at, as well as from the “Open Documentation” menu item in

What's Included?

How To Build consists of separate parts:

  1. The PostgreSQL binaries, including extensions and a bunch of command line tools. You can find the binaries in /Applications/

  2. The user interface, written in Swift. This is the native Mac app that you see when you double click in the Finder.

For compatibility reasons we build the different parts on different versions of macOS.

  • the binaries for PostgreSQL 9.4 - 10 are built on macOS 10.10

  • the binaries for PostgreSQL 11 - 12 are built on macOS 10.12 with Xcode 8.3.3

  • the GUI is built on macOS 10.15 with Xcode 10.1

It is of course possible to use other versions of macOS / Xcode (see details below), but those are the environments we use.

Building the GUI

If you want to work on the user interface only, you don't have to re-compile the binaries yourself. By default, the buildscript for just copies the binaries from /Applications/

So just make sure you have a copy of in your applications folder. Open the XCode file and start hacking!

Tools required for building the GUI:

  • Xcode 10.1

Currently it is not possible to use Xcode 11 because is written in Swift 3. Any help migrating to Swift 5 would be greatly appreciated!

Building the Binaries

If you want to build your own versions of all the PostgreSQL binaries, you have slightly more work to do.

The directories src-10, src-11 and src-12 each contain a makefile that downloads and builds all the binaries. If you have all the prerequisites installed (see below), you can just type make.

The makefile will download and build many gigabytes of sources. The default target (all) builds postgresql, postgis, plv8, and wal2json. PostGIS and especially plv8 take a long time to build, so if you don't need them, type make postgresql instead.

The makefile will install all products in /Applications/ (xx is the major version of PostgreSQL). So for best results, make sure that directory is empty before starting the build.

If you want to change the version number of any of the dependencies, edit the makefile (all version numbers are specified at the top).

You can use the -j option (eg. make -j 3 postgresql) for parallel builds. My recommendation is to use one more job than the number of logical processors you have. Since my macOS 10.12 VM is limited to 2 virtual CPUs, I use -j 3. However, parallel builds make debugging problems a lot harder, so don't use them when something doesn't work.

Always check the exit code of make to see if any errors occurred, eg. make -j 3 || echo "Build failed with exit code $?"

Prerequisites for building the binaries

At the very least, you need the following:

  • Xcode
  • Developer Tools (install with xcode-select -install)

For building PostGIS, you also need

  • autoconf
  • automake
  • pkgconfig (when building GDAL 3.0.0 or later)

By default, PostgreSQL is built with documentation. To build the docs, you need:

  • docbook-dsssl
  • docbook-sgml-4.2
  • docbook-xml-4.2
  • docbook-xsl-nons
  • libxslt
  • openjade
  • opensp

The quickest way to install all the dependencies is with MacPorts. Install MacPorts, then type:

sudo port install autoconf automake pkgconfig docbook-dsssl docbook-sgml-4.2 docbook-xml-4.2 docbook-xsl-nons libxslt openjade opensp

It may also be possible to install those using homebrew, but I'm not sure if they have all the required packages.

Under the Hood bundles the PostgreSQL binaries inside the application package. When you first start, here's what it does:

  • Initialise a database cluster: initdb -D DATA_DIRECTORY -EUTF-8 --locale=XX_XX.UTF-8
  • Start the server: pg_ctl start -D DATA_DIRECTORY -w -l DATA_DIRECTORY/postgres-server.log
  • Create a user database: createdb USERNAME

On subsequent app launches, only starts the server.

The default DATA_DIRECTORY is /Users/USERNAME/Library/Application Support/Postgres/var-9.X

Note that runs the server as your user, unlike other installations which might create a separate system user named postgres.

When you quit, it stops the server using the following command:

  • pg_ctl stop -w -D DATA_DIRECTORY

Command Line Utilities also includes useful command line utilities (note: this list may be outdated):

  • PostgreSQL: clusterdb createdb createlang createuser dropdb droplang dropuser ecpg initdb oid2name pg_archivecleanup pg_basebackup pg_config pg_controldata pg_ctl pg_dump pg_dumpall pg_receivexlog pg_resetxlog pg_restore pg_standby pg_test_fsync pg_test_timing pg_upgrade pgbench postgres postmaster psql reindexdb vacuumdb vacuumlo
  • PROJ.4: cs2cs geod invgeod invproj nad2bin proj
  • GDAL: gdal_contour gdal_grid gdal_rasterize gdal_translate gdaladdo gdalbuildvrt gdaldem gdalenhance gdalinfo gdallocationinfo gdalmanage gdalserver gdalsrsinfo gdaltindex gdaltransform gdalwarp nearblack ogr2ogr ogrinfo ogrtindex testepsg
  • PostGIS: pgsql2shp raster2pgsql shp2pgsql

See the documentation for more info.


If you find a bug, please open an issue. is maintained by Jakob Egger.

License is released under the PostgreSQL License. See LICENSE for additional information.