Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 5ca40c5

Browse files
committed
Add comment about rationale for continuing to use C library functions
instead of src/timezone for timestamping log entries.
1 parent ba6b87f commit 5ca40c5

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/backend/utils/error/elog.c

+11-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*
3838
*
3939
* IDENTIFICATION
40-
* $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.140 2004/06/03 02:08:04 tgl Exp $
40+
* $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.141 2004/06/21 14:12:38 tgl Exp $
4141
*
4242
*-------------------------------------------------------------------------
4343
*/
@@ -1214,6 +1214,16 @@ log_line_prefix(StringInfo buf)
12141214
break;
12151215
case 't':
12161216
{
1217+
/*
1218+
* Note: for %t and %s we deliberately use the C library's
1219+
* strftime/localtime, and not the equivalent functions
1220+
* from src/timezone. This ensures that all backends
1221+
* will report log entries in the same timezone, namely
1222+
* whatever C-library setting they inherit from the
1223+
* postmaster. If we used src/timezone then local
1224+
* settings of the TimeZone GUC variable would confuse
1225+
* the log.
1226+
*/
12171227
time_t stamp_time = time(NULL);
12181228
char strfbuf[128];
12191229

0 commit comments

Comments
 (0)