我在Mac上安装了Postgres服务器9.4的全新副本。我现在想从命令行手动启动和停止它。我在.bash_profile中定义了以下内容(当然也添加了PATH)
export PGSQL_HOME=/Library/PostgreSQL/9.4/bin
当我尝试启动服务器时,我得到以下内容
Joes-MacBook-Pro:~ postgres$ /Library/PostgreSQL/9.4/bin/pg_ctl -D /Library/PostgreSQL/9.4/data -l logfile start
pg_ctl: another server might be running; trying to start server anyway
server starting
Joes-MacBook-Pro:~ postgres$ /bin/sh: logfile: Permission denied
当我试图查看是否有任何服务器在运行时:
Joes-MacBook-Pro:~ postgres$ /Library/PostgreSQL/9.4/bin/pg_ctl status
pg_ctl: no database directory specified and environment variable PGDATA unset
Try "pg_ctl --help" for more information.
以下是一些更多信息:
Joes-MacBook-Pro:~ postgres$ ps x | grep postgres
263 ?? Ss 0:27.28 postgres: logger process
265 ?? Ss 2:04.57 postgres: writer process
266 ?? Ss 1:35.49 postgres: wal writer process
267 ?? Ss 0:21.52 postgres: autovacuum launcher process
268 ?? Ss 0:20.12 postgres: stats collector process
29416 ?? Ss 0:00.00 postgres: logger process
29418 ?? Ss 0:00.01 postgres: checkpointer process
29419 ?? Ss 0:00.09 postgres: writer process
29420 ?? Ss 0:00.03 postgres: wal writer process
29421 ?? Ss 0:00.03 postgres: autovacuum launcher process
29422 ?? Ss 0:00.08 postgres: stats collector process
31113 s000 S+ 0:00.00 grep postgres
这令人难以置信。我怎样才能确保我可以从Mac上的命令提示符手动启动和停止Postgres服务器?