When checking for datetime field overflow, we should allow a fractional-second
authorTom Lane <[email protected]>
Fri, 1 May 2009 19:29:34 +0000 (19:29 +0000)
committerTom Lane <[email protected]>
Fri, 1 May 2009 19:29:34 +0000 (19:29 +0000)
commit797c390d03b27a00c0d96396238c4e7343eda4d8
tree09dac4803df8c20c57948086688f79c187824a01
parentee95902c16dd6dca1f7314740ae82b59257d8f2d
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