MacOSXに開発用のpostgresql
を構築したときのメモ。
インストール
1
| $ brew install postgresql
|
サービスの起動とOS起動時の設定
1
| $ pg_ctl -D /usr/local/var/postgres start && brew $ services start postgresql
|
postgresロールがなかったのでつくる
1 2 3 4 5 6 7 8
| $ /usr/local/Cellar/postgresql/9.6.3/bin/createuser -s postgres $ psql postgres postgres=# \du List of roles Role name | Attributes | Member of -----------+------------------------------------------------------------+----------- postgres | Superuser, Create role, Create DB | {} shinya | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
|
DB作成
1
| $ /usr/local/Cellar/postgresql/9.6.3/bin/createdb rslite -U postgres
|
参考ページ
Getting Started with PostgreSQL on Mac OSX
psql: FATAL: role “postgres” does not exist