What's new. All postings for 2009 All postings for 2008 RSS Feed
Calendar Pictures Open-source contributions Really old pages DWright.org
View Dan Wright's profile on LinkedIn
Dan Wright's Facebook Profile
Wed, 06 Feb 2008

Getting PostgreSQL to run on OS X 10.5

I had some trouble getting PostgreSQL to work with launchd today. I googled a few articles, including this one but of the few that actually contained sample code, none of them seemed to work.

One thing I realized is that most of the examples out there try to invoke pg_ctl. This is a mistake. Launchd wants to be pg_ctl. The real solution seems to be to let launchd run postgre directly. So, here's my /Library/LaunchDaemons/org.postgresql.PostgreSQL.plist file. Hopefully this will be useful to somebody:

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>org.postgresql.PostgreSQL</string> <key>ProgramArguments</key> <array> <string>/usr/local/pgsql/bin/postgres</string> <string>-D</string> <string>/usr/local/pgsql/data</string> </array> <key>RunAtLoad</key> <true /> <key>UserName</key> <string>postgres</string> </dict> </plist>


posted at: 18:53 | permanent link to this entry | Comments: