Thread: PostgreSQL doesn't accept connections when Windows Server is rebooted

PostgreSQL doesn't accept connections when Windows Server is rebooted

From
George Weaver
Date:
Hi everyone,
 
I recently installed PostgreSQL (Version 8.1.5.1) using the MSI installer on a Windows Server 2000 system.
 
I installed PostgreSQL logged in under an Administrator account, with the service account set up as postgres with limited privileges.
 
During the installation process, when it came time to run initdb, the installer would stop with the error message:
 
     "Failed to run initdb: 128.  Please see the logfile in 'C:\Program Files\PostgreSQL\8.1\tmp\initdb.log. 
      Note!  You must read/copy this logfile before you click OK, or it will be automatically removed."
 
(As an aside, when this occurred, there was no initdb.log file - or any other file - in the 'C:\Program Files\PostgreSQL\8.1\tmp\ directory).
 
I surmized that the problem was that I was attempting to run the install as an Administrator, so I addressed the problem by running the install, but not having the installer run initdb step to intialize the database cluster.  When the install finished without error, I then logged onto the server under the postgres account and manually ran initdb.  I was able to initialize the cluster.
 
I then updated the postgresql.conf file with "listen_addresses = '*' and changed the port from 5432 (currently being used for a 7.3 server) to 5435.
 
Everything runs as expected.
 
Until the Windows Server is rebooted.  When this occurs, the PostgreSQL service starts as expected, but won't accept connections.
 
If the PostgreSQL service is then restarted manually (via Administrative Tools > Component Services > Restart), the service runs as expected and everything is normal.
 
How can I correct this?
 
Thanks in advance,
George
 
 
 

Re: PostgreSQL doesn't accept connections when Windows Server is rebooted

From
Jim Nasby
Date:
On Nov 21, 2006, at 9:15 AM, George Weaver wrote:
> I then updated the postgresql.conf file with "listen_addresses =
> '*' and changed the port from 5432 (currently being used for a 7.3
> server) to 5435.
>
> Everything runs as expected.
>
> Until the Windows Server is rebooted.  When this occurs, the
> PostgreSQL service starts as expected, but won't accept connections.
>
> If the PostgreSQL service is then restarted manually (via
> Administrative Tools > Component Services > Restart), the service
> runs as expected and everything is normal.

Maybe the server is running with a different .conf when started
automatically? IIRC you can see what PGDATA is via show, but of
course you'd need to connect to the server first...

netstat (or the windows equivalent) might also shed some light.
--
Jim Nasby                                            jim@nasby.net
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)