在不同系统中连接两个postgreSQL数据库时出错

时间:2013-05-17 05:40:13

标签: postgresql-9.2

我想连接两个不同系统的postgreSQL数据库。我使用dblink连接两个postgreSQL数据库。

但是我发现连接错误

ERROR:  could not establish connection
DETAIL:  could not connect to server: No route to host (0x00002751/10065)
Is the server running on host "192.168.0.5" and accepting
TCP/IP connections on port 5432?


********** Error **********

ERROR: could not establish connection
SQL state: 08001
Detail: could not connect to server: No route to host (0x00002751/10065)
Is the server running on host "192.168.0.5" and accepting
TCP/IP connections on port 5432?

我正在尝试的是

select * from dblink('user=postgres host=192.168.0.5 password=geethu dbname=partition','select  count(*) from part1') as qwe(tid int);

我已经编辑了hba.con文件以及postgresql.conf文件,包括ip地址并将listen_address设置为*

任何人都可以帮助我吗?提前致谢

1 个答案:

答案 0 :(得分:0)

  1. 您需要启用postgres从“不同系统”IP地址侦听端口5432,这可以通过编辑pg_hba.conf文件和postgres.conf文件来完成。查看here
  2. 确保没有阻止请求的防火墙。