Re: libpq debug log - Mailing list pgsql-hackers

From 'alvherre@alvh.no-ip.org'
Subject Re: libpq debug log
Date
Msg-id 20210331232055.GA3874@alvherre.pgsql
Whole thread Raw
In response to Re: libpq debug log  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Jaime Casanova
Date:
Subject: Re: Crash in BRIN minmax-multi indexes
Next
From: Zhihong Yu
Date:
Subject: Re: using extended statistics to improve join estimates