Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

After starting PostgreSQL 9.1, we see this error

Server doesn't listen

The server doesn't accept connections: the connection library reports could not connect to server: Connection refused Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432? could not connect to server: Connection refused

Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432? could not connect to server: Connection refused Is the server running on host "localhost" (fe80::1) and accepting TCP/IP connections on port 5432?

How can this be solved?

share|improve this question

migrated from stackoverflow.com Nov 1 '11 at 23:11

This question came from our site for professional and enthusiast programmers.

    
What OS? Some variety of linux? –  Frank Farmer Nov 1 '11 at 22:17
    
I migrated here rather than dba.SE because it's more likely to be a network stack issue (e.g. firewall) than a problem with Postgres. –  Kev Nov 1 '11 at 23:12
add comment

2 Answers

Check if PostgreSQL listens on 5432 using netstat -lnp | grep 5432 (if you use Linux, for Windows I use some tools from SysInternals like TCPView and ProcessExplorer). It should listen, if not then check PostgreSQL logs.

share|improve this answer
add comment

You can check if the server is really running by looking for some running postgres processes.
You can check the server's logfiles for startup errors.
You can check the server's configuration for the used listen_address and port_number and see if they are right.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.