|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * IDENTIFICATION
|
11 |
| - * $PostgreSQL: pgsql/src/backend/utils/adt/timestamp.c,v 1.156 2005/10/25 17:13:07 tgl Exp $ |
| 11 | + * $PostgreSQL: pgsql/src/backend/utils/adt/timestamp.c,v 1.157 2005/10/27 02:45:22 momjian Exp $ |
12 | 12 | *
|
13 | 13 | *-------------------------------------------------------------------------
|
14 | 14 | */
|
@@ -1943,8 +1943,31 @@ timestamp_mi(PG_FUNCTION_ARGS)
|
1943 | 1943 | result->month=0;
|
1944 | 1944 | result->day=0;
|
1945 | 1945 |
|
1946 |
| -/* this is wrong, but removing it breaks a lot of regression tests */ |
1947 |
| -result=DatumGetIntervalP(DirectFunctionCall1(interval_justify_hours, |
| 1946 | +/* |
| 1947 | + *This is wrong, but removing it breaks a lot of regression tests. |
| 1948 | + *For example: |
| 1949 | + * |
| 1950 | + *test=> SET timezone = 'EST5EDT'; |
| 1951 | + *test=> SELECT |
| 1952 | + *test-> ('2005-10-30 13:22:00-05'::timestamptz - |
| 1953 | + *test(> '2005-10-29 13:22:00-04'::timestamptz); |
| 1954 | + *?column? |
| 1955 | + *---------------- |
| 1956 | + * 1 day 01:00:00 |
| 1957 | + * (1 row) |
| 1958 | + * |
| 1959 | + *so adding that to the first timestamp gets: |
| 1960 | + * |
| 1961 | + * test=> SELECT |
| 1962 | + * test-> ('2005-10-29 13:22:00-04'::timestamptz + |
| 1963 | + * test(> ('2005-10-30 13:22:00-05'::timestamptz - |
| 1964 | + * test(> '2005-10-29 13:22:00-04'::timestamptz)) at time zone 'EST'; |
| 1965 | + * timezone |
| 1966 | + *-------------------- |
| 1967 | + *2005-10-30 14:22:00 |
| 1968 | + *(1 row) |
| 1969 | + */ |
| 1970 | +result=DatumGetIntervalP(DirectFunctionCall1(interval_justify_hours, |
1948 | 1971 | IntervalPGetDatum(result)));
|
1949 | 1972 |
|
1950 | 1973 | PG_RETURN_INTERVAL_P(result);
|
|