• Andres Freund's avatar
    Make logging_collector=on work with non-windows EXEC_BACKEND again. · 2be82dcf
    Andres Freund authored
    Commit b94ce6e8 reordered postmaster's startup sequence so that the
    tempfile directory is only cleaned up after all the necessary state
    for pg_ctl is collected.  Unfortunately the chosen location is after
    the syslogger has been started; which normally is fine, except for
    !WIN32 EXEC_BACKEND builds, which pass information to children via
    files in the temp directory.
    
    Move the call to RemovePgTempFiles() to just before the syslogger has
    started. That's the first child we fork.
    
    Luckily EXEC_BACKEND is pretty much only used by endusers on windows,
    which has a separate method to pass information to children. That
    means the real world impact of this bug is very small.
    
    Discussion: 20150113182344.GF12272@alap3.anarazel.de
    
    Backpatch to 9.1, just as the previous commit was.
    2be82dcf
postmaster.c 167 KB