Joseph Shraibman <jks@selectacast.net> writes:
> [root@d1 ~/postgresql-7.1/src/backend/utils/adt] diff -C 3
> datetime.c.orig datetime.c
> *** datetime.c.orig Thu May 3 21:16:37 2001
> --- datetime.c Thu May 3 21:19:51 2001
> ***************
> *** 2087,2092 ****
> --- 2087,2096 ----
> sec = (tm->tm_sec + fsec);
> + if (sec >= 59.995)
> + sec = 59.99; /* Round down to avoid times like
> 2001-05-03 21:18:60.00-04 */
> +
> +
> switch (style)
> {
> /* compatible with ISO date formats */
This is a horrid solution.
The correct solution is to round the original timestamp to two
fractional digits before it's ever broken down into y/m/d/h/m/s.
At least if you only want two digits of precision. I think Thomas
has been resisting making that change because he wants to allow
displaying more than two digits, instead.
BTW, is there really only one routine with this problem?
regards, tom lane