]> granicus.if.org Git - postgresql/commitdiff
Also fix rotation of csvlog on Windows.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 24 Jan 2013 09:41:30 +0000 (11:41 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 24 Jan 2013 09:41:30 +0000 (11:41 +0200)
Backpatch to 9.2, like the previous fix.

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);
        }