summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane2007-08-04 01:26:54 +0000
committerTom Lane2007-08-04 01:26:54 +0000
commitbdd6b62245fe7b5f25c4fec509b80ec930b6deff (patch)
tree91af2ffde788fdd2855b0dfb1c18e2bbb5aa50a1 /src/include
parent73852bd520c219051431a74ee511c4f29dd4baf3 (diff)
Switch over to using the src/timezone functions for formatting timestamps
displayed in the postmaster log. This avoids Windows-specific problems with localized time zone names that are in the wrong encoding, and generally seems like a good idea to forestall other potential platform-dependent issues. To preserve the existing behavior that all backends will log in the same time zone, create a new GUC variable log_timezone that can only be changed on a system-wide basis, and reference log-related calculations to that zone instead of the TimeZone variable. This fixes the issue reported by Hiroshi Saito that timestamps printed by xlog.c startup could be improperly localized on Windows. We still need a simpler patch for that problem in the back branches, however.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/commands/variable.h5
-rw-r--r--src/include/pgtime.h5
2 files changed, 7 insertions, 3 deletions
diff --git a/src/include/commands/variable.h b/src/include/commands/variable.h
index b1b308fbd0..ba26233e7d 100644
--- a/src/include/commands/variable.h
+++ b/src/include/commands/variable.h
@@ -5,7 +5,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/commands/variable.h,v 1.29 2007/01/05 22:19:54 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/commands/variable.h,v 1.30 2007/08/04 01:26:54 tgl Exp $
*/
#ifndef VARIABLE_H
#define VARIABLE_H
@@ -18,6 +18,9 @@ extern const char *assign_datestyle(const char *value,
extern const char *assign_timezone(const char *value,
bool doit, GucSource source);
extern const char *show_timezone(void);
+extern const char *assign_log_timezone(const char *value,
+ bool doit, GucSource source);
+extern const char *show_log_timezone(void);
extern const char *assign_XactIsoLevel(const char *value,
bool doit, GucSource source);
extern const char *show_XactIsoLevel(void);
diff --git a/src/include/pgtime.h b/src/include/pgtime.h
index f9056c90e0..b1ff5eac44 100644
--- a/src/include/pgtime.h
+++ b/src/include/pgtime.h
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/include/pgtime.h,v 1.15 2007/01/05 22:19:50 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/pgtime.h,v 1.16 2007/08/04 01:26:54 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -62,7 +62,8 @@ extern pg_tzenum *pg_tzenumerate_start(void);
extern pg_tz *pg_tzenumerate_next(pg_tzenum *dir);
extern void pg_tzenumerate_end(pg_tzenum *dir);
-extern pg_tz *global_timezone;
+extern pg_tz *session_timezone;
+extern pg_tz *log_timezone;
/* Maximum length of a timezone name (not including trailing null) */
#define TZ_STRLEN_MAX 255