aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/timestamp.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2003-02-22 05:57:45 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2003-02-22 05:57:45 +0000
commit80d6a277c921454d028e088762bb4a4723f9840e (patch)
treea00260ff44b3c75aa44afce2b7a9be850a139224 /src/backend/utils/adt/timestamp.c
parent799bc58dc7ed9899facfc8302040749cb0a9af2f (diff)
downloadpostgresql-80d6a277c921454d028e088762bb4a4723f9840e.tar.gz
postgresql-80d6a277c921454d028e088762bb4a4723f9840e.zip
Simplify timezone-handling code per proposal to pghackers: get rid of
setting timezone-related variables during transaction start. They were not used anyway in platforms that HAVE_TM_ZONE or HAVE_INT_TIMEZONE, which it appears is *all* the platforms we are currently supporting. For platforms that have neither, we now only support UTC or numeric- offset-from-UTC timezones.
Diffstat (limited to 'src/backend/utils/adt/timestamp.c')
-rw-r--r--src/backend/utils/adt/timestamp.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/backend/utils/adt/timestamp.c b/src/backend/utils/adt/timestamp.c
index bb094707a6f..6d63eef7a3b 100644
--- a/src/backend/utils/adt/timestamp.c
+++ b/src/backend/utils/adt/timestamp.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.77 2003/01/22 20:44:20 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.78 2003/02/22 05:57:45 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -808,11 +808,13 @@ timestamp2tm(Timestamp dt, int *tzp, struct tm * tm, fsec_t *fsec, char **tzn)
* later bypass any calls which adjust the tm fields.
*/
if (HasCTZSet && (tzp != NULL))
+ {
#ifdef HAVE_INT64_TIMESTAMP
dt -= (CTimeZone * INT64CONST(1000000));
#else
dt -= CTimeZone;
#endif
+ }
time = dt;
#ifdef HAVE_INT64_TIMESTAMP
@@ -908,9 +910,11 @@ timestamp2tm(Timestamp dt, int *tzp, struct tm * tm, fsec_t *fsec, char **tzn)
#endif
#else /* not (HAVE_TM_ZONE || HAVE_INT_TIMEZONE) */
- *tzp = CTimeZone; /* V7 conventions; don't know timezone? */
+ *tzp = 0;
+ /* Mark this as *no* time zone available */
+ tm->tm_isdst = -1;
if (tzn != NULL)
- *tzn = CTZName;
+ *tzn = NULL;
#endif
dt = dt2local(dt, *tzp);