HomebrewでMacにpostgresqlをインストールする
普段はPostgresqlのサイトで配布されているMac用のインストーラを使っているのですが、どうやらLionはまだサポートされていないようです。
ということで、homebrewを使ってインストールすることにしました。
Homebrewをインストール
以下を実行すればok
pre>>
/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
<<--
あとは
pre>>
brew install postgresql
<<--
でインストールし、以下でdbを初期化します。
pre>>
initdb /usr/local/var/postgres
<<--
最後に、自動起動の設定を行います。
pre>>
cp /usr/local/Cellar/postgresql/9.0.4/org.postgresql.postgres.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/org.postgresql.postgres.plist
<<--
brewでインストールした場合、postgresユーザは作成されないようです。
$USERがスーパユーザとして作成されます。