Index: src/backend/utils/adt/datetime.c =================================================================== RCS file: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v retrieving revision 1.147 diff -c -c -r1.147 datetime.c *** src/backend/utils/adt/datetime.c 26 May 2005 15:26:00 -0000 1.147 --- src/backend/utils/adt/datetime.c 26 May 2005 18:10:03 -0000 *************** *** 3461,3472 **** #ifdef HAVE_INT64_TIMESTAMP sprintf(str + strlen(str), ":%02d.%06d", tm->tm_sec, fsec); #else ! sprintf(str + strlen(str), ":%013.10f", tm->tm_sec + fsec); #endif ! /* chop off trailing pairs of zeros... */ ! while (strcmp((str + strlen(str) - 2), "00") == 0 && ! *(str + strlen(str) - 3) != '.') ! *(str + strlen(str) - 2) = '\0'; } else sprintf(str + strlen(str), ":%02d", tm->tm_sec); --- 3461,3469 ---- #ifdef HAVE_INT64_TIMESTAMP sprintf(str + strlen(str), ":%02d.%06d", tm->tm_sec, fsec); #else ! sprintf(str + strlen(str), ":%012.9f", tm->tm_sec + fsec); #endif ! TrimTrailingZeros(str); } else sprintf(str + strlen(str), ":%02d", tm->tm_sec); *************** *** 3804,3810 **** sprintf(cp, ".%06d", Abs(fsec)); #else fsec += tm->tm_sec; ! sprintf(cp, ":%013.10f", fabs(fsec)); #endif TrimTrailingZeros(cp); cp += strlen(cp); --- 3801,3807 ---- sprintf(cp, ".%06d", Abs(fsec)); #else fsec += tm->tm_sec; ! sprintf(cp, ":%012.9f", fabs(fsec)); #endif TrimTrailingZeros(cp); cp += strlen(cp); Index: src/interfaces/ecpg/pgtypeslib/interval.c =================================================================== RCS file: /cvsroot/pgsql/src/interfaces/ecpg/pgtypeslib/interval.c,v retrieving revision 1.19 diff -c -c -r1.19 interval.c *** src/interfaces/ecpg/pgtypeslib/interval.c 26 May 2005 16:44:05 -0000 1.19 --- src/interfaces/ecpg/pgtypeslib/interval.c 26 May 2005 18:10:04 -0000 *************** *** 511,517 **** sprintf(cp, ".%06d", Abs(fsec)); #else fsec += tm->tm_sec; ! sprintf(cp, ":%013.10f", fabs(fsec)); #endif TrimTrailingZeros(cp); cp += strlen(cp); --- 511,517 ---- sprintf(cp, ".%06d", Abs(fsec)); #else fsec += tm->tm_sec; ! sprintf(cp, ":%012.9f", fabs(fsec)); #endif TrimTrailingZeros(cp); cp += strlen(cp); Index: src/test/regress/expected/horology.out =================================================================== RCS file: /cvsroot/pgsql/src/test/regress/expected/horology.out,v retrieving revision 1.53 diff -c -c -r1.53 horology.out *** src/test/regress/expected/horology.out 7 Apr 2005 01:51:40 -0000 1.53 --- src/test/regress/expected/horology.out 26 May 2005 18:10:07 -0000 *************** *** 205,266 **** -- As of 7.4, allow time without time zone having a time zone specified SELECT time without time zone '040506.789+08'; time ! --------------- ! 04:05:06.7890 (1 row) SELECT time without time zone '040506.789-08'; time ! --------------- ! 04:05:06.7890 (1 row) SELECT time without time zone 'T040506.789+08'; time ! --------------- ! 04:05:06.7890 (1 row) SELECT time without time zone 'T040506.789-08'; time ! --------------- ! 04:05:06.7890 (1 row) SELECT time with time zone '040506.789+08'; timetz ! ------------------ ! 04:05:06.7890+08 (1 row) SELECT time with time zone '040506.789-08'; timetz ! ------------------ ! 04:05:06.7890-08 (1 row) SELECT time with time zone 'T040506.789+08'; timetz ! ------------------ ! 04:05:06.7890+08 (1 row) SELECT time with time zone 'T040506.789-08'; timetz ! ------------------ ! 04:05:06.7890-08 (1 row) SELECT time with time zone 'T040506.789 +08'; timetz ! ------------------ ! 04:05:06.7890+08 (1 row) SELECT time with time zone 'T040506.789 -08'; timetz ! ------------------ ! 04:05:06.7890-08 (1 row) SET DateStyle = 'Postgres, MDY'; --- 205,266 ---- -- As of 7.4, allow time without time zone having a time zone specified SELECT time without time zone '040506.789+08'; time ! -------------- ! 04:05:06.789 (1 row) SELECT time without time zone '040506.789-08'; time ! -------------- ! 04:05:06.789 (1 row) SELECT time without time zone 'T040506.789+08'; time ! -------------- ! 04:05:06.789 (1 row) SELECT time without time zone 'T040506.789-08'; time ! -------------- ! 04:05:06.789 (1 row) SELECT time with time zone '040506.789+08'; timetz ! ----------------- ! 04:05:06.789+08 (1 row) SELECT time with time zone '040506.789-08'; timetz ! ----------------- ! 04:05:06.789-08 (1 row) SELECT time with time zone 'T040506.789+08'; timetz ! ----------------- ! 04:05:06.789+08 (1 row) SELECT time with time zone 'T040506.789-08'; timetz ! ----------------- ! 04:05:06.789-08 (1 row) SELECT time with time zone 'T040506.789 +08'; timetz ! ----------------- ! 04:05:06.789+08 (1 row) SELECT time with time zone 'T040506.789 -08'; timetz ! ----------------- ! 04:05:06.789-08 (1 row) SET DateStyle = 'Postgres, MDY';