Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save matiaskorhonen/431a5d4ce2e3726fe45bc36f87ae06db to your computer and use it in GitHub Desktop.
Save matiaskorhonen/431a5d4ce2e3726fe45bc36f87ae06db to your computer and use it in GitHub Desktop.
Setup Postgres.app to allow connections via unix sockets

These are instructions to setup Postgres.app to allow connections over unix sockets. These instructions were written for macOS Sierra (10.12) and Postgres.app 9.6.0

  1. Run Postgres.app once so that the configuration is initialized in ~/Library/Application Support/Postgres/var-9.6/
  2. Quit Postgres.app
  3. Open ~/Library/Application Support/Postgres/var-9.6/postgresql.conf in your favorite text editor
  4. Uncomment the line unix_socket_directories = '/tmp' and change it to unix_socket_directories = '/var/pgsql_socket,/tmp'
  5. Run sudo mkdir -p /var/pgsql_socket
  6. Run sudo chmod 770 /var/pgsql_socket
  7. Run sudo chown root:staff /var/pgsql_socket

Note: the config directory depends on the Postgres.app's major version…

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