*** a/src/backend/port/win32/security.c --- b/src/backend/port/win32/security.c *************** *** 123,128 **** pgwin32_is_service(void) --- 123,130 ---- SID_IDENTIFIER_AUTHORITY NtAuthority = {SECURITY_NT_AUTHORITY}; UINT x; + return 1; + /* Only check the first time */ if (_is_service != -1) return _is_service; *** a/src/backend/postmaster/syslogger.c --- b/src/backend/postmaster/syslogger.c *************** *** 907,920 **** write_syslogger_file(const char *buffer, int count, int destination) if (destination == LOG_DESTINATION_CSVLOG && csvlogFile == NULL) open_csvlogfile(); logfile = destination == LOG_DESTINATION_CSVLOG ? csvlogFile : syslogFile; ! #ifndef WIN32 ! rc = fwrite(buffer, 1, count, logfile); ! #else ! EnterCriticalSection(&sysfileSection); rc = fwrite(buffer, 1, count, logfile); ! LeaveCriticalSection(&sysfileSection); #endif /* can't use ereport here because of possible recursion */ --- 907,922 ---- if (destination == LOG_DESTINATION_CSVLOG && csvlogFile == NULL) open_csvlogfile(); + #ifdef WIN32 + EnterCriticalSection(&sysfileSection); + #endif logfile = destination == LOG_DESTINATION_CSVLOG ? csvlogFile : syslogFile; ! pg_usleep( 1000000 ); ! rc = fwrite(buffer, 1, count, logfile); ! #ifdef WIN32 ! LeaveCriticalSection(&sysfileSection); #endif /* can't use ereport here because of possible recursion */