From 168d315703287989fd9dab0badb212c529e88691 Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Thu, 24 Jan 2013 11:41:30 +0200 Subject: [PATCH] Also fix rotation of csvlog on Windows. Backpatch to 9.2, like the previous fix. --- src/backend/postmaster/syslogger.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/backend/postmaster/syslogger.c b/src/backend/postmaster/syslogger.c index 534d69ec14..d113011be7 100644 --- a/src/backend/postmaster/syslogger.c +++ b/src/backend/postmaster/syslogger.c @@ -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); } -- 2.40.0