Postgresql 9.1 Multiple Cluster on same host

postgresql

I have 2 cluster databases, running on the same host, Ubuntu. My fist database port is set to default but my second database port is set to 5433 in the postgresql.conf file. While everything is ok with local connections, I cannot connect using any of my tools to the second database with port 5433, including pgAdmin. Please help. Any parameter that I need to modify for the new database with port 5433?

netstat -an | grep 5433 shows,

tcp 0 0 0.0.0.0:5433 0.0.0.0:* LISTEN 
tcp6 0 0 :::5433 :::* LISTEN 
unix 2 [ ACC ] STREAM LISTENING 72842 /var/run/postgresql/.s.PGSQL.5433

iptables -L shows,

Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Best Answer

First, please post error messages. Otherwise this is shooting in the dark.

You could have a bunch of problems. I would suggest the following:

  1. If you simply get a connection refused, try netstat -p | grep 5433 so you can see what programs are listening on the port. Is it something unexpected?

  2. If you are getting pg_hba.conf errors, double check your settings there.

  3. Please check again your listen settings in your postgresql.conf file.

  4. Check your postgresql log on the cluster you are having trouble with. Please post relevant sections if this doesn't get you to your answer.