无法在Mac上检查PostgreSQL Server状态



在我的Mac上,我在一个特定的位置安装了一个Postgres服务器,并将其添加到我的.bash_profile中。当我尝试启动时,我遇到了一些错误:

Joes-MacBook-Pro:~ postgres$ /Users/joe/Softwares/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.

然后我试着检查安装Postgres的文件夹,这是我看到的

drwxr-xr-x    3 joe    staff        102 Nov 23  2013 AngularJS
drwxr-xr-x    4 root   daemon       136 Apr 18 15:58 PostgreSQL

这是我的.bash_profile 中的内容

export PGDATA=/Users/joe/Softwares/PostgreSQL/9.4/data
export PGSQL_HOME=/Users/joe/Softwares/PostgreSQL/9.4/bin

我应该将PostgreSQL文件夹的用户和组从root更改为postgres吗?

注意:我不是以postgres用户的身份登录的。我正在尝试从另一个叫joe的用户启动postgres!

即使设置了PGDATA,也不确定为什么会失败!我必须做以下事情才能使它工作!

从命令行:

/Users/joe/Softwares/PostgreSQL/9.4/bin/pg_ctl -D /Users/joe/Softwares/PostgreSQL/9.4/data status

最新更新