I wrote: > While looking over the thread, I remembered I wanted to convert > strerror_r into a wrapper as well. Think I'll go do that next, > because really it'd be better for snprintf.c to be calling strerror_r > not strerror.
So while chasing that, I realized that libpq contains its own version of the backend's win32_socket_strerror code, in libpq/win32.c. This probably explains why we've not heard complaints about bogus socket error reports from libpq; it's that code that's handling it. What I think ought to happen is to merge win32.c's version of that code into strerror.c, which'd allow removing win32.c and win32.h altogether. However, not having a Windows environment, I can't test such changes and probably shouldn't be the one to take point on making the change. Anybody? regards, tom lane