

Stop postgresql: pg_ctl -D /usr/local/var/postgres stop -s -m fast Finally, symlink psql (and other libpq tools) into /usr/local/bin: brew link -force libpq. Here are a few more commands that you can find useful: From your command line, run the following commands: brew doctor brew update brew install libpq. To quit psql, type the following command: \qīy now, you should have a working postgresql server with PostGIS support enabled. Let’s check if we have PostGIS support: SELECT PostGIS_Version() To enable PostGIS, execute the following command: CREATE EXTENSION postgis If everything goes well, we should see the psql command prompt: We’ll use the psql command line utility to connect to the database that we’ve just created: psql postgis_test Let’s call it postgis_test createdb postgis_test The rest of the data should already be set up correctly. Password: The password you set, in my case, password. As for the connection details, you should use: User: The one you just created, in my case chris. For the type, you can choose 'PostgreSQL'. If that’s a fresh installation, we need to initialize the database cluster: initdb /usr/local/var/postgres Open the app, and create a new connection. Let’s check if postgres is running: export PGDATA='/usr/local/var/postgres' pg_ctl status In the terminal, run: pg_ctl -D /usr/local/var/postgres start To Start the server, we will use the command line utility pg_ctl. Once again, homebrew will inform us about the progress:

To install PostgreSQL open the terminal and run the following command: brew install postgresīy default the postgresql server will be installed under: /usr/local/var/postgresīack in the terminal run: brew install postgis We’ll use Homebrew to install the required packages, so make sure you have Homebrew installed on your system.
Install local postgresql mac mac os#
In this tutorial, we will see how to install PostGIS on Mac OS X. It is at the core of CartoDB and plays nicely with QGIS, Tilemill / Mapbox Studio and GDAL.

PostGIS can handle large amounts of data. If you used the EnterpriseDB installer then see the other answer in this thread.
Install local postgresql mac how to#
PostGISis a powerful extension to the PostgreSQL database that adds support for geometry types and geospatial functions such as point, line, polygon, distance, area, union, intersection, etc. Assuming you installed PostgreSQL with homebrew as referenced in check status of postgresql server Mac OS X and how to start postgresql server on mac os x: you can use the brew uninstall postgresql command.
