【发布时间】:2020-10-27 18:11:01
【问题描述】:
我在 OSX 上有一个 Postgres 9.6 实例已启动并正在运行,但是当我在带有 sqitch.conf 的工作目录中尝试 sqitch status 时,Sqitch 抛出以下错误:
$ sqitch status
# On database db:pg:my_db
could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
这很奇怪,因为我已经通过检查 Postgres 的状态并直接登录来检查它是否正在运行:
$ pg_isready
/tmp:5432 - accepting connections
$ psql -U postgres
psql (9.6.19)
Type "help" for help.
postgres=#
这似乎只是sqitch 的问题。
更多细节,这个 Postgres 是通过brew install postgresql@9.6 安装的,位于默认目录中:
$ which psql
/usr/local/opt/postgresql@9.6/bin/psql
关于 Sqitch,我尝试过使用 Homebrew 安装和使用 Docker(我目前的方法)。 docker install 基于官方说明:
docker pull sqitch/sqitch
curl -L https://git.io/JJKCn -o sqitch && chmod +x sqitch
./sqitch status
我尝试使用sqitch config --user engine.pg.client /usr/local/opt/postgresql@9.6/bin/psql 显式设置psql
无论如何,我仍然使用任何sqitch 命令得到以下信息:
$ sqitch status
# On database db:pg:my_db
could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
我不确定我缺少什么并且可以使用一些输入。提前致谢。
【问题讨论】:
-
参见
connections on Unix domain socket /var/run/postgresql/.s.PGSQL.5432与/tmp:5432 - accepting connections。这通常发生在针对不同版本的libpq编译或链接程序时。我会尝试将您的连接更改为指向localhost而不是套接字(本地)。
标签: postgresql sqitch