環境:OS X Mavericks (10.9.4)
- インストール
$ brew install postgresql
- UTF-8で初期化
$ initdb /usr/local/var/postgres -E utf8
- 手動で起動
$ postgres -D /usr/local/var/postgres
- データベース一覧で確認
$ psql -l
- 環境変数PGDATAを設定。.zshrcに以下を記述
$export PGDATA=/usr/local/var/postgres
- バージョン確認
$ psql -V
- 自動起動を設定。
$ cp /usr/local/Cellar/postgresql/9.3.2/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/
$ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist