Re: Postgres service startup

From: Dave Page <dpage(at)postgresql(dot)org>
To: M S <arthur_ringworn(at)yahoo(dot)co(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Postgres service startup
Date: 2007-08-06 11:07:08
Message-ID: 46B700DC.5010206@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 I can'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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adam Witney 2007-08-06 11:11:31 Re: import content of XLS file into PostgreSQL
Previous Message M S 2007-08-06 10:44:09 Postgres service startup