在Mac上安装PostgreSQL 2019版

使用Homebrew安装

brew install postgresql

截至2019年2月,已安装了PostgreSQL 11。

发挥力量

==> Downloading https://homebrew.bintray.com/bottles/postgresql-11.1_1.mojave.bottle.1.tar.gz
######################################################################## 100.0%
==> Pouring postgresql-11.1_1.mojave.bottle.1.tar.gz
==> /usr/local/Cellar/postgresql/11.1_1/bin/initdb /usr/local/var/postgres
==> Caveats
To migrate existing data from a previous major version of PostgreSQL run:
  brew postgresql-upgrade-database

To have launchd start postgresql now and restart at login:
  brew services start postgresql
Or, if you don't want/need a background service you can just run:
  pg_ctl -D /usr/local/var/postgres start
==> Summary
?  /usr/local/Cellar/postgresql/11.1_1: 3,548 files, 40.3MB

开始

使用 brew services 命令进行启动。

brew services start postgresql

停下来

brew services stop postgresql

请以以下一份资料为参考。

    MacにPostgreSQLをインストール
bannerAds