I am trying to connect from Arc Cataloge (version 10.1) to postgresql 9.2. But every time I try to make "Database Connection" I am getting this error:

Failed to connect to the specified server.
Underlying DBMS error[could not connect to server: Connection timed out
   Is the server running on host"x.y.z.w" and accepting TCP/IP connections on port 5432?

Postgresql is installed on Centos server (PORT 5432) and I can access it using pgadmin.

Using psql --h X.Y.Z.W -U user -d database on another server I am getting the same error.

here is the content of pg_hba.conf:

 local   all             all                                md5
 # IPv4 local connections:
 host    all             all            X.Y.Z.W/32          md5
 host    all             all             md5
 host    all             all          md5
 # IPv6 local connections:
 host    all             all             ::1/128            md5

Also in postgresql.conf:

Listen_addresses = '*'

in etc/sysconfig/iptables:

  4 :INPUT ACCEPT [0:0]
  6 :OUTPUT ACCEPT [0:0]
  7 :RH-Firewall-1-INPUT - [0:0]
  8 -A INPUT -j RH-Firewall-1-INPUT
  9 -A FORWARD -j RH-Firewall-1-INPUT
 10 -A RH-Firewall-1-INPUT -i lo -j ACCEPT
 11 -A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT
 12 -A RH-Firewall-1-INPUT -p 50 -j ACCEPT
 13 -A RH-Firewall-1-INPUT -p 51 -j ACCEPT
 14 -A RH-Firewall-1-INPUT -p udp --dport 5353 -d -j ACCEPT
 15 -A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT
 16 -A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT
 17 -A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
 18 -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
 19 -A INPUT -m state --state NEW -m tcp -p tcp --dport 5432 -j ACCEPT
 20 -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
 21 -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
 22 -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5432 -j ACCEPT

I also put "postgresql-client-libraries" in /bin directory of ArcGIS for Desktop.

I appreciate any help.

  • So like pg_hba.conf needs changing to allow access, see Configure Postgres – Activate password authentication kelvinwong.ca/tag/pg_hba-conf
    – Mapperz
    Aug 27, 2013 at 13:29

1 Answer 1


alright ,it is working:

1) in /etc/sysconfig/iptables: I removed line 21 -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited

2)pg_hba.conf: I only used this: host all all md5

  • Just so that you know, your pg_hba file is allowing connections from all IP addresses; Your database is wide open. I would not suggest keeping it like that in a public facing website. Aug 28, 2013 at 4:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.