On 2021-Mar-31, Tom Lane wrote:
> While this may have little to do with drongo's issue,
> I'm going to take exception to this bit that I see that
> the patch added to PQtrace():
>
> /* Make the trace stream line-buffered */
> setvbuf(debug_port, NULL, _IOLBF, 0);
Mea culpa. I added this early on because it made PQtrace's use more
comfortable, but I agree that it's a mistake. Removed. I put it in
libpq_pipeline.c instead.
> ... and as for an actual explanation for drongo's issue,
> I'm sort of wondering why libpq_pipeline.c is opening the
> trace file in "w+" mode rather than vanilla "w" mode.
> That seems unnecessary, and maybe it doesn't work so well
> on Windows.
well, at least the MSVC documentation claims that it works, but who
knows. I removed that too.
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/fopen-wfopen?view=msvc-160
--
Álvaro Herrera Valdivia, Chile