Fix lookup tables used for rounding interval data values when not using
authorThomas G. Lockhart <lockhart@alumni.caltech.edu>
Tue, 14 May 2002 13:37:27 +0000 (13:37 +0000)
committerThomas G. Lockhart <lockhart@alumni.caltech.edu>
Tue, 14 May 2002 13:37:27 +0000 (13:37 +0000)
 integer datetimes. Thanks to Tom Lane for spotting the problem.

src/backend/utils/adt/timestamp.c

index d1d845695d5ee5a022719d9b0b45d1a39287ee71..9df4c8a39ebda68e910d47811b5613db9b7410f1 100644 (file)
@@ -463,23 +463,23 @@ AdjustIntervalForTypmod(Interval *interval, int32 typmod)
        };
 #else
        static const double IntervalScales[MAX_INTERVAL_PRECISION+1] = {
-               1000000,
-               100000,
-               10000,
-               1000,
-               100,
+               1,
                10,
-               1
+               100,
+               1000,
+               10000,
+               100000,
+               1000000
        };
 
        static const double IntervalOffsets[MAX_INTERVAL_PRECISION+1] = {
-               -500000,
-               -50000,
-               -5000,
-               -500,
-               -50,
-               -5,
-               0
+               0.5,
+               0.05,
+               0.005,
+               0.0005,
+               0.00005,
+               0.000005,
+               0.0000005
        };
 #endif