Skip to content

Commit ad8fbb5

Browse files
committed
Cleanup items from csvlog changes, per ITAGAKI Takahiro.
1 parent bab16af commit ad8fbb5

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/backend/postmaster/syslogger.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*
1919
*
2020
* IDENTIFICATION
21-
* $PostgreSQL: pgsql/src/backend/postmaster/syslogger.c,v 1.38 2007/08/21 01:47:19 tgl Exp $
21+
* $PostgreSQL: pgsql/src/backend/postmaster/syslogger.c,v 1.39 2007/09/20 18:19:08 adunstan Exp $
2222
*
2323
*-------------------------------------------------------------------------
2424
*/
@@ -352,7 +352,15 @@ SysLoggerMain(int argc, char *argv[])
352352
}
353353

354354
if (rotation_requested)
355+
{
356+
/*
357+
* Force rotation when both values are zero.
358+
* It means the request was sent by pg_rotate_logfile.
359+
*/
360+
if (!time_based_rotation && size_rotation_for == 0)
361+
size_rotation_for = LOG_DESTINATION_STDERR | LOG_DESTINATION_CSVLOG;
355362
logfile_rotate(time_based_rotation, size_rotation_for);
363+
}
356364

357365
#ifndef WIN32
358366

@@ -1154,7 +1162,7 @@ logfile_rotate(bool time_based_rotation, int size_rotation_for)
11541162
EnterCriticalSection(&sysfileSection);
11551163
#endif
11561164
fclose(csvlogFile);
1157-
syslogFile = fh;
1165+
csvlogFile = fh;
11581166
#ifdef WIN32
11591167
LeaveCriticalSection(&sysfileSection);
11601168
#endif

src/backend/utils/misc/postgresql.conf.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@
312312

313313

314314
#silent_mode = off # DO NOT USE without syslog or
315-
# redirect_stderr
315+
# logging_collector
316316
# (change requires restart)
317317

318318
# - What to Log -

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy