diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-08-04 01:26:54 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-08-04 01:26:54 +0000 |
commit | bdd6b62245fe7b5f25c4fec509b80ec930b6deff (patch) | |
tree | 91af2ffde788fdd2855b0dfb1c18e2bbb5aa50a1 /src/backend/utils/adt/datetime.c | |
parent | 73852bd520c219051431a74ee511c4f29dd4baf3 (diff) | |
download | postgresql-bdd6b62245fe7b5f25c4fec509b80ec930b6deff.tar.gz postgresql-bdd6b62245fe7b5f25c4fec509b80ec930b6deff.zip |
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/backend/utils/adt/datetime.c')
-rw-r--r-- | src/backend/utils/adt/datetime.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c index ddd4fa6167d..742a328b280 100644 --- a/src/backend/utils/adt/datetime.c +++ b/src/backend/utils/adt/datetime.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.181 2007/06/12 15:58:32 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.182 2007/08/04 01:26:53 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1325,7 +1325,7 @@ DecodeDateTime(char **field, int *ftype, int nf, if (fmask & DTK_M(DTZMOD)) return DTERR_BAD_FORMAT; - *tzp = DetermineTimeZoneOffset(tm, global_timezone); + *tzp = DetermineTimeZoneOffset(tm, session_timezone); } } @@ -1361,7 +1361,7 @@ DetermineTimeZoneOffset(struct pg_tm * tm, pg_tz *tzp) after_isdst; int res; - if (tzp == global_timezone && HasCTZSet) + if (tzp == session_timezone && HasCTZSet) { tm->tm_isdst = 0; /* for lack of a better idea */ return CTimeZone; @@ -2033,7 +2033,7 @@ DecodeTimeOnly(char **field, int *ftype, int nf, tmp->tm_hour = tm->tm_hour; tmp->tm_min = tm->tm_min; tmp->tm_sec = tm->tm_sec; - *tzp = DetermineTimeZoneOffset(tmp, global_timezone); + *tzp = DetermineTimeZoneOffset(tmp, session_timezone); tm->tm_isdst = tmp->tm_isdst; } |