Code for SET/SHOW TIME ZONE with a fixed-interval timezone was not
authorTom Lane <[email protected]>
Sun, 5 Jun 2005 01:49:06 +0000 (01:49 +0000)
committerTom Lane <[email protected]>
Sun, 5 Jun 2005 01:49:06 +0000 (01:49 +0000)
prepared for HAVE_INT64_TIMESTAMP.  Per report from Guillaume Beaudoin.

src/backend/commands/variable.c

index 1955da250e4a1396891d815798298b03eb476c5c..ff100afdc06fc1e89e5e850afbe5e9329220ea29 100644 (file)
@@ -284,7 +284,11 @@ assign_timezone(const char *value, bool doit, GucSource source)
                if (doit)
                {
                        /* Here we change from SQL to Unix sign convention */
+#ifdef HAVE_INT64_TIMESTAMP
+                       CTimeZone = -(interval->time / USECS_PER_SEC);
+#else
                        CTimeZone = -interval->time;
+#endif
 
                        HasCTZSet = true;
                }
@@ -398,8 +402,12 @@ show_timezone(void)
        {
                Interval interval;
 
-               interval.       month = 0;
-               interval.       time = -CTimeZone;
+               interval.month = 0;
+#ifdef HAVE_INT64_TIMESTAMP
+               interval.time = -(CTimeZone * USECS_PER_SEC);
+#else
+               interval.time = -CTimeZone;
+#endif
 
                tzn = DatumGetCString(DirectFunctionCall1(interval_out,
                                                                                  IntervalPGetDatum(&interval)));