我只是通过重新安装了postgres brew install postgres
我跑了,initdb /usr/local/var/postgres -E utf8
但是得到了:
The files belonging to this database system will be owned by user "atal421".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.UTF-8".
The default text search configuration will be set to "english".
initdb: directory "/usr/local/var/postgres" exists but is not empty
If you want to create a new database system, either remove or empty
the directory "/usr/local/var/postgres" or run initdb
with an argument other than "/usr/local/var/postgres".
因此,我rm -rf
在postgres文件夹中再次运行它:
initdb /usr/local/var/postgres -E utf8
它说一切都很好:
Success. You can now start the database server using:
postgres -D /usr/local/var/postgres
因此,我运行了该命令并得到:
postgres -D /usr/local/var/postgres
FATAL: lock file "postmaster.pid" already exists
HINT: Is another postmaster (PID 13731) running in data directory "/usr/local/var/postgres"?
现在,当我查看活动监视器时,可以看到6个postgress实例。
我该如何解决?
postgres
具有postmaster和五个实用程序后端的实例。PostgreSQL是一个多进程的体系结构。