From 7cb1d01c9099d7897d1ccfffec2acf262445e16b Mon Sep 17 00:00:00 2001 From: Andrew Dunstan Date: Thu, 20 Sep 2007 18:19:08 +0000 Subject: [PATCH] Cleanup items from csvlog changes, per ITAGAKI Takahiro. --- src/backend/postmaster/syslogger.c | 10 +++++++++- src/backend/utils/misc/postgresql.conf.sample | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/backend/postmaster/syslogger.c b/src/backend/postmaster/syslogger.c index d5d6ece950..27483205b1 100644 --- a/src/backend/postmaster/syslogger.c +++ b/src/backend/postmaster/syslogger.c @@ -352,7 +352,15 @@ SysLoggerMain(int argc, char *argv[]) } if (rotation_requested) + { + /* + * Force rotation when both values are zero. + * It means the request was sent by pg_rotate_logfile. + */ + if (!time_based_rotation && size_rotation_for == 0) + size_rotation_for = LOG_DESTINATION_STDERR | LOG_DESTINATION_CSVLOG; logfile_rotate(time_based_rotation, size_rotation_for); + } #ifndef WIN32 @@ -1154,7 +1162,7 @@ logfile_rotate(bool time_based_rotation, int size_rotation_for) EnterCriticalSection(&sysfileSection); #endif fclose(csvlogFile); - syslogFile = fh; + csvlogFile = fh; #ifdef WIN32 LeaveCriticalSection(&sysfileSection); #endif diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample index 470f96ca96..3816210d85 100644 --- a/src/backend/utils/misc/postgresql.conf.sample +++ b/src/backend/utils/misc/postgresql.conf.sample @@ -312,7 +312,7 @@ #silent_mode = off # DO NOT USE without syslog or - # redirect_stderr + # logging_collector # (change requires restart) # - What to Log - -- 2.39.5