diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index 069ab9a8fb..b3b65f5f0d 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -1,4 +1,4 @@ - + Server Configuration @@ -2398,16 +2398,20 @@ local0.* /var/log/postgresql so %-escapes can be used to specify time-varying file names. (Note that if there are any time-zone-dependent %-escapes, the computation - is done in the zone specified by .) - If no %-escapes are present, - PostgreSQL will append the epoch of the new - log file's creation time. For example, if - log_filename were server_log, - then the chosen file name would be server_log.1093827753 - for a log starting at Sun Aug 29 19:02:33 2004 MST. + is done in the zone specified + by .) Note that the system's strftime is not used directly, so platform-specific (nonstandard) extensions do not work. + + If you specify a file name without escapes, you should plan to + use a log rotation utility to avoid eventually filling the + entire disk. In releases prior to 8.4, if + no % escapes were + present, PostgreSQL would append + the epoch of the new log file's creation time, but this is no + longer the case. + If CSV-format output is enabled in log_destination, .csv will be appended to the timestamped diff --git a/src/backend/postmaster/syslogger.c b/src/backend/postmaster/syslogger.c index 5c9eb1654f..189ca58bba 100644 --- a/src/backend/postmaster/syslogger.c +++ b/src/backend/postmaster/syslogger.c @@ -18,7 +18,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/postmaster/syslogger.c,v 1.48 2009/02/03 00:59:26 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/postmaster/syslogger.c,v 1.49 2009/02/24 12:09:09 petere Exp $ * *------------------------------------------------------------------------- */ @@ -1191,18 +1191,9 @@ logfile_getname(pg_time_t timestamp, char *suffix) len = strlen(filename); - if (strchr(Log_filename, '%')) - { - /* treat it as a strftime pattern */ - pg_strftime(filename + len, MAXPGPATH - len, Log_filename, - pg_localtime(×tamp, log_timezone)); - } - else - { - /* no strftime escapes, so append timestamp to new filename */ - snprintf(filename + len, MAXPGPATH - len, "%s.%lu", - Log_filename, (unsigned long) timestamp); - } + /* treat it as a strftime pattern */ + pg_strftime(filename + len, MAXPGPATH - len, Log_filename, + pg_localtime(×tamp, log_timezone)); if (suffix != NULL) {