Markus Schiltknecht <markus@bluegap.ch> writes:
> is there a good reason to print the "database system is ready" message
> in StartupXLOG() in xact.c? It has a) nothing to do with xlog and b)
> opens a small race condition: the message gets printed, while it still
> take some CPU cycles until the postmaster really gets the SIGCHLD signal
> and sets StartupPID = 0. If you (or rather: an automated test program)
> try to connect within this timespan, you get a "database is starting up"
> error, which clearly contradicts the "is ready" message.
I've applied a modified form of this patch. The postmaster now says
"database system is ready to accept connections" after it's finished
reacting to the completion of the startup process.
regards, tom lane