% brew install -s postgresql@15 Running `brew update --auto-update`... ==> Fetching postgresql@15 ==> Downloading https://ftp.postgresql.org/pub/source/v15.1/postgresql-15.1.tar.bz2 # 2.0% ######################################################################## 100.0% ==> ./configure --prefix=/opt/homebrew/Cellar/postgresql@15/15.1 --libdir=/opt/homebrew/Cellar/postgresql@15/15.1/lib --datadir=/opt/homebrew/opt/postgresql@15/share/postgresql@15 --libdir=/opt/homebrew/o ==> make pkglibdir=/opt/homebrew/opt/postgresql@15/lib/postgresql pkgincludedir=/opt/homebrew/opt/postgresql@15/include/postgresql includedir_server=/opt/homebrew/opt/postgresql@15/include/postgresql/serv ==> make install-world datadir=/opt/homebrew/Cellar/postgresql@15/15.1/share/postgresql@15 libdir=/opt/homebrew/Cellar/postgresql@15/15.1/lib pkglibdir=/opt/homebrew/Cellar/postgresql@15/15.1/lib/postgres ==> /opt/homebrew/Cellar/postgresql@15/15.1/bin/initdb --locale=C -E UTF-8 /opt/homebrew/var/postgresql@15 ==> Caveats This formula has created a default database cluster with: initdb --locale=C -E UTF-8 /opt/homebrew/var/postgresql@15 For more details, read: https://www.postgresql.org/docs/15/app-initdb.html postgresql@15 is keg-only, which means it was not symlinked into /opt/homebrew, because this is an alternate version of another formula. If you need to have postgresql@15 first in your PATH, run: echo 'export PATH="/opt/homebrew/opt/postgresql@15/bin:$PATH"' >> ~/.zshrc For compilers to find postgresql@15 you may need to set: export LDFLAGS="-L/opt/homebrew/opt/postgresql@15/lib" export CPPFLAGS="-I/opt/homebrew/opt/postgresql@15/include" To restart postgresql@15 after an upgrade: brew services restart postgresql@15 Or, if you don't want/need a background service you can just run: /opt/homebrew/opt/postgresql@15/bin/postgres -D /opt/homebrew/var/postgresql@15 ==> Summary 标签:opt,...,15,Logs,Removing,brew,postgresql From: https://www.cnblogs.com/Primzahl/p/17885946.html