Alexander Law <exclusion@gmail.com> writes:
> 07.12.2019 22:26 Tom Lane <tgl@sss.pgh.pa.us>:
>> It seems like it'd be cleaner to fix both of these things at once
>> by opening the logfile ourselves (rather than letting CMD.EXE do it)
>> and using sharing-friendly parameters at that point. But maybe it's
>> just not worth the trouble compared to the individual hacks.
> If we couldn't find more advantages of rewriting create process (with
> logfile), I would restrict changes to one hack (or two, if really needed).
Yeah, I agree that it doesn't yet seem worthwhile to do that sort of
rewrite.
Also, I realized that blaming CMD.EXE for holding the logfile open is
wrong: it's actually the postmaster itself that still has the file
open after it's removed postmaster.pid. (Well, maybe CMD.EXE still
has a handle too, but that would be weird; and it's not necessary
to explain the problem.) Short of doing our own redirection, the
only way to fix that would be for the postmaster to close its own
stdout and stderr before removing the pidfile, which is obviously
a bad idea.
Hence, I pushed this patch, with a revised comment. We'll see
how it affects the buildfarm.
regards, tom lane