stevengharms.com

Sententiae viri ex temporibus duobus

PostgreSQL Database Automatic Launch on OSX 10.6 Snow Leopard

It took a while to find this, but here’s my solution

Add this file: /Library/LaunchDaemons/org.postgres.launchd.plist






    
    Label
      org.postgres.launchd
    Disabled
      
    UserName
      _pgsql
    GroupName
      _pgsql
    Program
      /usr/local/pgsql/bin/postmaster
      EnvironmentVariables
      
              PGDATA
              /usr/local/pgsql/data/
      
    RunAtLoad
      



You can then load it and unload it by issuing:

$ sudo launchctl load /Library/LaunchDaemons/org.postgres.launchd.plist
$ sudo launchctl unload /Library/LaunchDaemons/org.postgres.launchd.plist

Now get to making some great Rails stuff!

Comments