in reply to Re: Error while connecting to postgres through DBI
in thread Error while connecting to postgres through DBI

laddakh is not going to be an acceptable hostname.

Actually, the error message proves that your assumption is not correct. The error says "Connection refused". That specifically means that a TCP connection was successful in reaching the target host (IP address) but that the specified port number was not listening for incoming connections. So the host name ('laddakh') is one part of the connection spec that we can be certain is not invalid.

Since many people are not aware of the precise meaning of "Connection refused", the error even elaborates quite a bit about it in hopes or helping out:

could not connect to server: Connection refused Is the server running on host "laddakh" and accepting TCP/IP connections on port 5432?

So this means that no postgresql server is running on the (valid) host 'laddakh' at port 5432. Possible explanations:

  1. The postgresql server software has not been installed there yet
  2. The postgresql server is simply not running at the moment and just needs to be started
  3. The postgresql server has been configured to use a TCP port other than the default of 5432
  4. The postgresql server has been configured to not use any TCP port at all
  5. The server is up and running, just on a host other than 'laddakh'.

- tye        

  • Comment on Re^2: Error while connecting to postgres through DBI (connection refused)

Replies are listed 'Best First'.
Re^3: Error while connecting to postgres through DBI (connection refused)
by lamprecht (Friar) on Jun 09, 2011 at 10:04 UTC
    6. postgres is running but 5432 is blocked by a firewall

    Cheers, Chris