Perl DBI:连接到 REMOTE PostgreSQL 数据库仍然抱怨本地套接字文件

Perl DBI: connect to REMOTE PostgreSQL db still complains about local socket file

我正在尝试使用 DBIx::Class 连接到 远程 PostgreSQL 数据库。 我的连接字符串:"DBI:Pg:database=asterisk:host=example.com:hostaddr=10.10.10.10:port=5432", $user, $pass

example.com 确实解析为“10.10.10.10”,将两者都交换到 IP 或仅使用 host=IP 都会导致

 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"? at /usr/local/share/perl/5.10.1/DBIx/Class/Storage/DBI.pm line 1489. at db-access.pl line 26

在这个 debian 上我没有或不需要 postgresql,但是我有 libdbd-pg-perlDBI->available_drivers 说我有 Pg(在我安装库之前没有)。

我怎样才能知道它正在尝试做什么以及我是否需要安装其他任何东西?有问题的服务器配置为允许来自 10.100.* 地址的连接,机器 运行 此代码所在的地址,我可以使用我的工作站(同一网络)上的 PSequel 和 pgAdmin 等工具连接到它有问题的数据库用户。

"DBI:Pg:database=asterisk:host=example.com:hostaddr=10.10.10.10:port=5432"

应该是:

"DBI:Pg:database=asterisk;host=example.com;hostaddr=10.10.10.10;port=5432"

只有前两个分隔符是冒号。其余的应该是分号。