*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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
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);
}
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.137 2006/10/14 23:07:22 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.138 2006/11/21 22:19:46 tgl Exp $
*
*-------------------------------------------------------------------------
*/
{
char buf[256];
- if (strftime(buf, 256, "%Y-%m-%d %H:%M:%S %Z", localtime(&tim)) != 0)
+ /*
+ * We don't print the timezone on Win32, because the names are long and
+ * localized, which means they may contain characters in various random
+ * encodings; this has been seen to cause encoding errors when reading
+ * the dump script.
+ */
+ if (strftime(buf, sizeof(buf),
+#ifndef WIN32
+ "%Y-%m-%d %H:%M:%S %Z",
+#else
+ "%Y-%m-%d %H:%M:%S",
+#endif
+ localtime(&tim)) != 0)
ahprintf(AH, "-- %s %s\n\n", msg, buf);
}
* Portions Copyright (c) 1994, Regents of the University of California
*
*
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.84 2006/10/07 20:59:05 petere Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.85 2006/11/21 22:19:46 tgl Exp $
*
*-------------------------------------------------------------------------
*/
char buf[256];
time_t now = time(NULL);
- if (strftime(buf, 256, "%Y-%m-%d %H:%M:%S %Z", localtime(&now)) != 0)
+ /*
+ * We don't print the timezone on Win32, because the names are long and
+ * localized, which means they may contain characters in various random
+ * encodings; this has been seen to cause encoding errors when reading
+ * the dump script.
+ */
+ if (strftime(buf, sizeof(buf),
+#ifndef WIN32
+ "%Y-%m-%d %H:%M:%S %Z",
+#else
+ "%Y-%m-%d %H:%M:%S",
+#endif
+ localtime(&now)) != 0)
printf("-- %s %s\n\n", msg, buf);
}