]> 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:20 +0000 (19:29 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 1 May 2009 19:29:20 +0000 (19:29 +0000)
commit5558c58c837e3a5ae2a91ee303183eaefeacd9b7
tree0d47352ed7a0091e99ef78339b5f492056ce8aa9
parent879a04f75e3650c20202a77ea26d552cad4f3d0e
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