MacでPostgre設定〜ただのメモ〜

HomebrewにてPostgreをインストールする。

brew install postgresql

シンボリックリンクを貼る

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

ログイン時に自動起動

$ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

ログイン時に自動起動させなくする

$ launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

パスワード設定

まずログイン

$ psql postgres

これで設定

postgres=# \password

postgres=# \q

コマンド

¥l          一覧表示
CREATE DATABASE   データベース名; 作成
\c データベース名   選択
DROP DATABASE    データベース名; 削除
\q またはctrl+d    終了
\?          ヘルプ

参考

macでPostgreSQLをインストールする - pyar.bz