• Tom Lane's avatar
    Improve corner cases in pg_ctl's new wait-for-postmaster-startup code. · 0bae3bc9
    Tom Lane authored
    With "-w -t 0", we should report "still starting up", not "ok".  If we
    fall out of the loop without ever being able to call PQping (because we
    were never able to construct a connection string), report "no response",
    not "ok".  This gets rid of corner cases in which we'd claim the server
    had started even though it had not.
    
    Also, if the postmaster.pid file is not there at any point after we've
    waited 5 seconds, assume the postmaster has failed and report that, rather
    than almost-certainly-fruitlessly continuing to wait.  The pidfile should
    appear almost instantly even when there is extensive startup work to do,
    so 5 seconds is already a very conservative figure.  This part is per a
    gripe from MauMau --- there might be better ways to do it, but nothing
    simple enough to get done for 9.1.
    0bae3bc9
pg_ctl.c 54.4 KB