Skip to content

Instantly share code, notes, and snippets.

@j1n6
Last active May 9, 2017 22:21
Show Gist options
  • Save j1n6/5868571 to your computer and use it in GitHub Desktop.
Save j1n6/5868571 to your computer and use it in GitHub Desktop.

Add to brew tap

brew tap petere/postgresql

Install 9.3

brew install postgresql-9.3

You might want to add /usr/local/opt/postgresql-9.3/bin/ into path:

export PATH=/usr/local/opt/postgresql-9.3/bin:$PATH

initialize database

/usr/local/opt/postgresql-9.3/bin/initdb /usr/local/var/postgres-9.3 -E utf8

symbolic link to launch agent

ln -sfv /usr/local/opt/postgresql-9.3/*.plist ~/Library/LaunchAgents

start on system start up

launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

File is suppose to be loaded under

/usr/local/opt/postgresql-9.3/homebrew.mxcl.postgresql.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>homebrew.mxcl.postgresql</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/opt/postgresql-9.3/bin/postgres</string>
<string>-D</string>
<string>/usr/local/var/postgres-9.3</string>
<string>-r</string>
<string>/usr/local/var/postgres-9.3/server.log</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>/usr/local</string>
<key>StandardErrorPath</key>
<string>/usr/local/var/postgres-9.3/server.log</string>
</dict>
</plist>
@AntonAL
Copy link

AntonAL commented May 9, 2017

Thank You!
Your Formula helped me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment