]> granicus.if.org Git - postgresql/blobdiff - src/backend/postmaster/syslogger.c
Also fix rotation of csvlog on Windows.
[postgresql] / src / backend / postmaster / syslogger.c
index 534d69ec140516f31b9e275b18355f290149b9bc..d113011be7ce76ebadcabd688c620161c615da0a 100644 (file)
@@ -1064,10 +1064,12 @@ pipeThread(void *arg)
                 * If we've filled the current logfile, nudge the main thread to do a
                 * log rotation.
                 */
-               if (Log_RotationSize > 0 &&
-                       ftell(syslogFile) >= Log_RotationSize * 1024L)
-                       SetLatch(&sysLoggerLatch);
-
+               if (Log_RotationSize > 0)
+               {
+                       if (ftell(syslogFile) >= Log_RotationSize * 1024L ||
+                               (csvlogFile != NULL && ftell(csvlogFile) >= Log_RotationSize * 1024L))
+                               SetLatch(&sysLoggerLatch);
+               }
                LeaveCriticalSection(&sysloggerSection);
        }