Restart PostgreSQL On Macintosh OSX From The Command Line

I don’t currently have a Mac but do get to work on them from time to time. A friend of mine recently had an issue with PostgreSQL on his Macbook Pro running OSX. In the process of helping him I needed to restart Postgres from a terminal window but wasn’t sure of where Postgres was installed.

PostgreSQL Default Install Location on OSX:

The default install location for Postgres on OSX is /Library/PostgreSQL. In this case the installed version was PostgreSQL 8.3 so the default directory is /Library/PostgreSQL/8.3. The directory structure is the same as a PostgreSQL installation on other versions of Linux.

Restart PostgreSQL On OSX:


  1. pg_ctl -D /Library/PostgreSQL/8.3/data restart

Issue the above command as the postgres user to signal the application to restart. If you have made a configuration change and just need the PostgreSQL database to load the new configuration changes then issue the below command as the postgres user.

Reload PostgreSQL on OSX:


  1. pg_ctl -D /Library/PostgreSQL/8.3/data reload

To find out more information on the pg_ctl command you can type “man pg_ctl” form a terminal window on your Mac.

Mac OS X for Unix Geeks (Leopard) (Paperback)

List Price: $34.99 USD
New From: $17.48 USD In Stock
Used from: $0.01 USD In Stock

PostgreSQL 8.4 Official Documentation – Volume III. Server Programming (Paperback)

List Price: $30.99 USD
New From: $18.58 USD In Stock
Used from: $23.06 USD In Stock