On 2018-May-27, Thomas Munro wrote:
> Out of curiosity I tried adding a GetLastError variable for Windows
> (to hide the function of that name and break callers) to the earlier
> experimental patch (attached). I had to give it an initial value to
> get rid of a warning about an unused variable (by my reading of the
> documentation, __pragma(warning(suppress:4101)) can be used in macros
> (unlike #pragma) and should shut that warning up, but it doesn't work
> for me, not sure why). Of course that produces many errors since we
> do that all over the place:
>
> https://ci.appveyor.com/project/macdice/postgres/build/1.0.184
Ouch.
This seems to say that we oughta assign GetLastError() to saved_errno
during errstart, then use %m in the errmsg() instead.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services