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.

Today, my PostgreSQL doesn't start anymore on my windows machine...

I've tried to start the service in windows services and got the following error:

Windows could not start the PostgreSQL Database Server 8.3 service on Local Computer.

Error 1053: The service did not respond to the start or control request in a timely fashion.

Then I went to the command line to manually start C:/Program Files (x86)/PostgreSQL/8.3/bin/psql.exe, and then I got this error:

psql: Could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "???" and accepting TCP/IP connections on port 5432?

Edit: I found this in the logs:

2011-04-22 13:13:16 CEST LOG:  could not receive data from client: No connection could be made because the target machine actively refused it.


2011-04-22 13:13:16 CEST LOG:  unexpected EOF on client connection
share|improve this question

migrated from stackoverflow.com Apr 23 '11 at 13:09

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

    
Can you look in your postgresql log files and post any relevant message. Log files are located in the pg_log subdirectory of your postgres data folder. Which is probably c:\program files (x86)\postgresql\8.3\data –  Eelke Apr 23 '11 at 13:51
    
Also take a look at the event log. –  Milen A. Radev Apr 24 '11 at 9:55
    
I editted my post with the information I found in the logs... –  Sander Declerck Apr 24 '11 at 16:45
    
Can you run netstat -aon | find "5432" and see if any other processes are running on that port? –  gravyface Apr 24 '11 at 17:44
add comment

2 Answers

PostgreSQL is having an error on startup and to find out what it is you will have to start PostgreSQL manually. PostgreSQL does not log its startup failures as often as you would hope and how i find out what is going on is by starting a cmd.exe window under the postgres user and manually starting PostgreSQL.

Run this to start a CMD.exe under the postgres user

runas /user:postgres cmd.exe

Enter in the postgres password. And then in that new CMD window start PostgreSQL

"C:/Program Files (x86)/PostgreSQL/8.3/bin/postgres.exe" -D "C:/Program Files (x86)/PostgreSQL/8.3/data"

And let us know the output...

share|improve this answer
add comment

That log data is from a running server! Is that the end of the newest log if so it not even seems to create new log files anymore.

When postgresql is started it is passed the path to the data folder using the -D option. If you go to the windows services manager you should be able to check that path there. See if that matches with the actual path. If it contains forward slashes instead of backslashes that's normal in this case. If the path is wrong you will have to dive into the registry to correct it as the service manager doesn't give you a method to change it.

While you are in the service manager also check the postgres service runs under the postgres user account.

Also check the postgres user has all rights on the data folder. Other users shouldn't have rights on the folder.

If this doesn't help maybe you better try making a backup of your data folder. Uninstall postgres reinstall the same version. DON'T put back your backup, first check if it is working. Then stop the server put the backup back start the server and keep your fingers crossed.

share|improve this answer
add comment

Your Answer

 
discard

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

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