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:

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:

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)

By (author): Ernest E. Rothman, Brian Jepson, Rich Rosen

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

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

By (author): The PostgreSQL Global Development Group

List Price: $30.99 USD
New From: $23.98 USD In Stock
Used from: $9.95 USD In Stock

Tags: , , , , , , , , , , , ,
Leave a Reply

*Type the letter/number combination in the abvoe field before clicking submit.