macOS

安装包

(https://www.enterprisedb.com/download-postgresql-binaries)[https://www.enterprisedb.com/download-postgresql-binaries]

初始化

./bin/initdb -D /Volumes/sm/repos/postgre -A trust

启动

./bin/pg_ctl -D /Volumes/sm/repos/postgre -l /Volumes/sm/repos/postgre/log.log start

停止

./bin/pg_ctl -D /Volumes/sm/repos/postgre -l /Volumes/sm/repos/postgre/log.log stop

Reference:

Setup and run PostgreSQL without any administrative rights in MacOS