I added the above code as first execution code in main() function and I am able to
reproduce the WER popup.
> My point is, With this patch, in case if the postgres crashses > before reaching main(), does it generate a popup? > > If the answer to the above question is yes, then if the popup is > not attended by the DBA, I feel the postmaster is not able to > restart all the processes because it is waiting for the crash process > to close. Am I Correct?
IIRC, the pop up doesn't appear under Windows service. If you start the database server with pg_ctl start on the command prompt, the pop up will appear, which I think is not bad.
Yes, the popup doesn't appear when it is started as service and appear when it is started from command prompt.
I also think that scenarios of starting the server from command prompt may be less, so this patch can be useful
to find out the issue by the starting the server from command prompt.