Postgresql 应该能够在没有主机Postgres.app的情况下运行psql

Postgresql 应该能够在没有主机Postgres.app的情况下运行psql,postgresql,postgres.app,Postgresql,Postgres.app,app文档逐字说明了这一点:一旦正确设置了路径,就应该能够在没有主机的情况下运行psql。如果没有,请检查路径中是否加载了正确的版本,因为psql对我来说不是这样 这就是我要说的。没有Postgres.app,任何地方都没有大象: $ which psql /Applications/Postgres.app/Contents/Versions/9.3/bin/psql 这是正确的,Heroku说要寻找的。Heroku还告诉我下面的命令应该可以工作,但它不能: $ psql -h localh

app文档逐字说明了这一点:一旦正确设置了路径,就应该能够在没有主机的情况下运行psql。如果没有,请检查路径中是否加载了正确的版本,因为psql对我来说不是这样

这就是我要说的。没有Postgres.app,任何地方都没有大象:

$ which psql
/Applications/Postgres.app/Contents/Versions/9.3/bin/psql
这是正确的,Heroku说要寻找的。Heroku还告诉我下面的命令应该可以工作,但它不能:

$ psql -h localhost
psql: could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (fe80::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
但是,当我双击postgres.app并打开它时,我可以让它工作

$ psql
psql (9.3.3)
Type "help" for help.

johncurry=#
文档特别指出,它应该在没有本地主机的情况下工作。我的设置是否正确,或者我是否需要更改某些内容?上面的代码让我感觉一切正常,但是没有主机的情况下应该可以正常工作让我不确定。

您使用的是postgres.app中的psql。默认情况下,它配置为从postgres.app连接到数据库服务器。如果postgres.app没有运行,这将不起作用

如果没有-h,您必须运行postgres.app


如果您想运行后台PostgreSQL server,postgres.app不是您想要的。从自制软件安装或使用EnterpriseDB安装程序包。

好的,谢谢。那么,他们为什么说没有主机,这是什么意思?他们的意思是没有指定-h参数,即使用unix套接字。请要求他们使用他们提供的任何文档反馈选项来改进相关文档。