Prevent Postgresql from running at startup

29

Note that with PostgreSQL 9.0 (and probably newer) on Mac OS 10.6.8 (and probably older), in order to prevent the PostgreSQL server from auto-starting, you have to:

  1. Go to /Library/LaunchDaemons/
  2. Open com.edb.launchd.postgresql-9.0.plist in an editor as root(replace 9.0 with your correct version number), e.g. sudo vim com.edb.launchd.postgresql-9.0.plist.
  3. Locate the line <key>RunAtLoad</key>
  4. Change the next line from <true/> to <false/>
  5. Save and exit.

That should do it. Also, if you want to stop the server immediately, without restarting, su to postgres and run /Library/PostgreSQL/9.0/bin/pg_ctl stop -D<your data dir>. You can find out which is your current data dir with ps aux|grep postgre.

Source: http://forums.enterprisedb.com/posts/list/2240.page#8321