我开始在我的Mac上使用PostgreSQL,但我对如何应对它感到难过
我尝试了以下网站提供的说明:
http://exponential.io/blog/2015/02/21/install-postgresql-on-mac-os-x-via-brew/ https://www.codementor.io/devops/tutorial/getting-started-postgresql-server-mac-osx https://gist.github.com/sgnl/609557ebacd3378f3b72
但收效甚微。
这是我的终端日志: -
Pavan7Vasans-MacBook-Pro:~ pavan7vasan$ brew install postgresql
Updating Homebrew...
Warning: postgresql 9.6.5 is already installed
Pavan7Vasans-MacBook-Pro:~ pavan7vasan$ postgres --version
postgres (PostgreSQL) 9.3.5
Pavan7Vasans-MacBook-Pro:~ pavan7vasan$ psql postgres
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
Pavan7Vasans-MacBook-Pro:~ pavan7vasan$ which postgresql
Pavan7Vasans-MacBook-Pro:~ pavan7vasan$ which postgres
/usr/local/php5/bin/postgres
Pavan7Vasans-MacBook-Pro:~ pavan7vasan$ postgres -D /usr/local/var/postgres
LOG: unrecognized configuration parameter "dynamic_shared_memory_type" in file "/usr/local/var/postgres/postgresql.conf" line 126
FATAL: configuration file "/usr/local/var/postgres/postgresql.conf" contains errors
Pavan7Vasans-MacBook-Pro:~ pavan7vasan$ postgres -D
/usr/local/php5/bin/postgres
postgres cannot access the server configuration file
"/usr/local/php5/bin/postgres/postgresql.conf": Not a directory
Pavan7Vasans-MacBook-Pro:~ pavan7vasan$ pg_ctl -D /usr/local/var/postgres start && brew services start postgresql
server starting
LOG: unrecognized configuration parameter "dynamic_shared_memory_type" in file "/usr/local/var/postgres/postgresql.conf" line 126
FATAL: configuration file "/usr/local/var/postgres/postgresql.conf" contains errors
Service `postgresql` already started, use `brew services restart
postgresql` to restart.
Pavan7Vasans-MacBook-Pro:~ pavan7vasan$ brew services restart postgresql
Stopping `postgresql`... (might take a while)
==> Successfully stopped `postgresql` (label: homebrew.mxcl.postgresql)
==> Successfully started `postgresql` (label: homebrew.mxcl.postgresql)
Pavan7Vasans-MacBook-Pro:~ pavan7vasan$ postgres -V
postgres (PostgreSQL) 9.3.5
Pavan7Vasans-MacBook-Pro:~ pavan7vasan$
我修复的是,尽管通过自制软件安装了最新版本的PostgreSQL,但当前版本为9.3.5
这是因为which postgres
命令显示的旧版PostgreSQL存在冲突吗?
由于旧版本的上述错误是否仍然是当前版本?
如果可能,如何将版本更改为最新版本?
请告诉我要做什么