Homebrew インストール
$ brew install postgresql
文字コードUTF-8でデータベースの初期化
$ initdb /usr/local/var/postgres -E utf8
PostgresSQlサーバー起動
$ postgres -D /usr/local/var/postgres
ここでPermission deniedのエラーが出た
FATAL: could not create lock file "/tmp/.s.PGSQL.5432.lock": Permission denied
権限を与える
sudo chmod 1777 /private/tmp
エラー解消された
再びサーバー起動
$ postgres -D /usr/local/var/postgres
動いた
Pgadmin4をインストール
brew install pgadmin4 --cask
参考記事
思いの外エラーで手間取ったので、備忘録として作成