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?

link|improve this question
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
feedback

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

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

2 Answers

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.

link|improve this answer
feedback

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.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown