Re: Postgres service startup - Mailing list pgsql-general

From Dave Page
Subject Re: Postgres service startup
Date
Msg-id 46B700DC.5010206@postgresql.org
Whole thread Raw
In response to Postgres service startup  (M S <arthur_ringworn@yahoo.co.uk>)
List pgsql-general
M S wrote:
> Hi, I'm getting errors in my application which suggest that Postgres has not completely started
> when it has told the Windows Service Control Manager that is has.
>
> Postgres log file extracts which (I believe) support this are shown below:
>
> 2007-08-06 10:27:42 LOG:  database system was shut down at 2007-08-06 09:55:16 GMT Daylight Time
> 2007-08-06 10:27:42 LOG:  checkpoint record is at 0/29C8BE0
> 2007-08-06 10:27:42 LOG:  redo record is at 0/29C8BE0; undo record is at 0/0; shutdown TRUE
> 2007-08-06 10:27:42 LOG:  next transaction ID: 0/1881853; next OID: 21761
> 2007-08-06 10:27:42 LOG:  next MultiXactId: 46; next MultiXactOffset: 91
> 2007-08-06 10:27:42 LOG:  database system is ready
> 2007-08-06 10:27:56 FATAL:  the database system is starting up
> 2007-08-06 10:27:57 FATAL:  the database system is starting up
> 2007-08-06 10:27:57 FATAL:  the database system is starting up
> 2007-08-06 10:27:57 FATAL:  the database system is starting up
>
> The fatal errors generated by our app have a later timestamp than the message "database system is ready".
>
> Looking in the registry for the service start options, pg_ctl.exe is being called with the runserver argument (which
Ican't find documented anywhere I'm afraid). 
> I have tried adding a -w switch but it prevented the service from starting.
>
> Has anyone got any suggestions?

This has been fixed for 8.2.5 and 8.3:


http://developer.postgresql.org/cvsweb.cgi/pgsql/src/bin/pg_ctl/pg_ctl.c?rev=1.74.2.1;content-type=text%2Fx-cvsweb-markup

In the meantime, can you delay yoour app startup, per haps by sleeping
for a few seconds in a batch file?

Regards, Dave.

pgsql-general by date:

Previous
From: M S
Date:
Subject: Postgres service startup
Next
From: Adam Witney
Date:
Subject: Re: import content of XLS file into PostgreSQL