]> granicus.if.org Git - postgresql/commit
When checking for datetime field overflow, we should allow a fractional-second
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 1 May 2009 19:29:27 +0000 (19:29 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 1 May 2009 19:29:27 +0000 (19:29 +0000)
commitd2d9bd0e04a4b744117ba4edfedb9b3ee441a7be
tree4fcbb176884a5dc7fcb0ba188d9b893ffb005c6c
parent3204d56fd010cd76f68a385d444c695359e708e6
When checking for datetime field overflow, we should allow a fractional-second
part that rounds up to exactly 1.0 second.  The previous coding rejected input
like "00:12:57.9999999999999999999999999999", with the exact number of nines
needed to cause failure varying depending on float-timestamp option and
possibly on platform.  Obviously this should round up to the next integral
second, if we don't have enough precision to distinguish the value from that.
Per bug #4789 from Robert Kruus.

In passing, fix a missed check for fractional seconds in one copy of the
"is it greater than 24:00:00" code.

Broken all the way back, so patch all the way back.
src/backend/utils/adt/datetime.c