Thread: Postgres service startup

Postgres service startup

From
M S
Date:
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'tfind documented anywhere I'm afraid). 
I have tried adding a -w switch but it prevented the service from starting.

Has anyone got any suggestions?




      ___________________________________________________________
Yahoo! Mail is the world's favourite email. Don't settle for less, sign up for
your free account today http://uk.rd.yahoo.com/evt=44106/*http://uk.docs.yahoo.com/mail/winter07.html

Re: Postgres service startup

From
Dave Page
Date:
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.

Re: Postgres service startup

From
M S
Date:
> This has been fixed for 8.2.5 and 8.3

Splendid, thanks for the reply. Is there a list of stuff to be done before 8.2.5 anywhere?

> In the meantime, can you delay your app startup, perhaps by sleeping for a few seconds in a batch file?

Yeah, we can put a quick fix in now, safe in the knowledge that it won't be needed for long.




      ___________________________________________________________
Yahoo! Mail is the world's favourite email. Don't settle for less, sign up for
your free account today http://uk.rd.yahoo.com/evt=44106/*http://uk.docs.yahoo.com/mail/winter07.html