diff --git a/src/backend/utils/adt/timestamp.c b/src/backend/utils/adt/timestamp.c index c04a735aae..4f82faa6cd 100644 --- a/src/backend/utils/adt/timestamp.c +++ b/src/backend/utils/adt/timestamp.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/adt/timestamp.c,v 1.159 2005/11/22 18:17:23 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/timestamp.c,v 1.160 2005/11/22 22:30:33 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1943,21 +1943,30 @@ timestamp_mi(PG_FUNCTION_ARGS) result->month = 0; result->day = 0; - /* - * This is wrong, but removing it breaks a lot of regression tests. For - * example: + /*---------- + * This is wrong, but removing it breaks a lot of regression tests. + * For example: * - * test=> SET timezone = 'EST5EDT'; test=> SELECT test-> ('2005-10-30 - * 13:22:00-05'::timestamptz - test(> '2005-10-29 - * 13:22:00-04'::timestamptz); ?column? ---------------- 1 day 01:00:00 (1 - * row) + * test=> SET timezone = 'EST5EDT'; + * test=> SELECT + * test-> ('2005-10-30 13:22:00-05'::timestamptz - + * test(> '2005-10-29 13:22:00-04'::timestamptz); + * ?column? + * ---------------- + * 1 day 01:00:00 + * (1 row) * - * so adding that to the first timestamp gets: + * so adding that to the first timestamp gets: * - * test=> SELECT test-> ('2005-10-29 13:22:00-04'::timestamptz + test(> - * ('2005-10-30 13:22:00-05'::timestamptz - test(> '2005-10-29 - * 13:22:00-04'::timestamptz)) at time zone 'EST'; timezone - * -------------------- 2005-10-30 14:22:00 (1 row) + * test=> SELECT + * test-> ('2005-10-29 13:22:00-04'::timestamptz + + * test(> ('2005-10-30 13:22:00-05'::timestamptz - + * test(> '2005-10-29 13:22:00-04'::timestamptz)) at time zone 'EST'; + * timezone + * -------------------- + * 2005-10-30 14:22:00 + * (1 row) + *---------- */ result = DatumGetIntervalP(DirectFunctionCall1(interval_justify_hours, IntervalPGetDatum(result)));