diff --git a/src/port/snprintf.c b/src/port/snprintf.c index 83a8103..17dc505 100644 --- a/src/port/snprintf.c +++ b/src/port/snprintf.c @@ -313,6 +313,14 @@ flushbuffer(PrintfTarget *target) target->failed = true; } target->bufptr = target->bufstart; + /* + * Sometimes the output to stdout on Windows on multicore machines + * does not go through after connecting and disconnecting to the server + * using the PQconnectdbParams and PQfinish functions. + */ +#ifdef WIN32 + fflush(target->stream); +#endif }