1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-07 00:36:50 +03:00

Suppress timezone (%Z) part of timestamp display when running on Windows,

because on that platform strftime produces localized zone names in varying
encodings.  Even though it's only in a comment, this can cause encoding
errors when reloading the dump script.  Per suggestion from Andreas
Seltenreich.  Also, suppress %Z on Windows in the %s escape of
log_line_prefix ... not sure why this one is different from the other two,
but it shouldn't be.
This commit is contained in:
Tom Lane
2006-11-21 22:19:46 +00:00
parent c714e5cba7
commit 5fc2d7e451
3 changed files with 35 additions and 6 deletions

View File

@ -42,7 +42,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.176 2006/11/21 00:49:55 tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.177 2006/11/21 22:19:46 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -1471,7 +1471,7 @@ log_line_prefix(StringInfo buf)
char strfbuf[128];
strftime(strfbuf, sizeof(strfbuf),
/* Win32 timezone names are too long so don't print them. */
/* Win32 timezone names are too long so don't print them */
#ifndef WIN32
"%Y-%m-%d %H:%M:%S %Z",
#else
@ -1487,7 +1487,12 @@ log_line_prefix(StringInfo buf)
char strfbuf[128];
strftime(strfbuf, sizeof(strfbuf),
/* Win32 timezone names are too long so don't print them */
#ifndef WIN32
"%Y-%m-%d %H:%M:%S %Z",
#else
"%Y-%m-%d %H:%M:%S",
#endif
localtime(&MyProcPort->session_start));
appendStringInfoString(buf, strfbuf);
}