Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've installed it. I see it running. I just can't figure out how to stop it. Or start it again.

Any good references on the net? All I've found is admin apps I have to pay for.

share|improve this question

migrated from Jan 18 '10 at 0:09

This question came from our site for professional and enthusiast programmers.

I'm going to assume you installed it using macports. Something like sudo port install postgresql84-server

Typically, to "activate" the server, you'd need to run something like

sudo -u postgres /opt/local/lib/postgresql84/bin/initdb /opt/local/var/db/postgresql84/defaultdb/

to create the database directory. Then use

launchctl load -w /opt/local/etc/LaunchDaemons/org.macports.postgresql84-server/org.macports.postgresql84-server.plist

To turn it off permantently, use

launchctl unload -w /opt/local/etc/LaunchDaemons/org.macports.postgresql84-server/org.macports.postgresql84-server.plist

Typically after it finishes building and installing, macports will tell you these things.

Finally, to use it, you'll typically want to put it into your path:

export PATH=$PATH:/opt/local/lib/postgresql84/bin

Then you use be able to use normal commands, like

createuser my_user 
createdb -O my_user my_database
psql -U postgres
share|improve this answer

Was it started through launchd? If it was, then man launchctl is your friend.

share|improve this answer

pgadminIII is a good administration tool. It's freely available.

It doesn't allow you to start and stop the server, but it is a great way to get started without having to know DDL statements. It's also very good for viewing data and running ad-hoc queries.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.