pgsql: When checking for datetime field overflow, we should allow a - Mailing list pgsql-committers

From tgl@postgresql.org (Tom Lane)
Subject pgsql: When checking for datetime field overflow, we should allow a
Date
Msg-id 20090501192920.E83CA75407B@cvs.postgresql.org
Whole thread Raw
List pgsql-committers
Log Message:
-----------
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.

Tags:
----
REL8_2_STABLE

Modified Files:
--------------
    pgsql/src/backend/utils/adt:
        datetime.c (r1.174.2.5 -> r1.174.2.6)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/datetime.c?r1=1.174.2.5&r2=1.174.2.6)

pgsql-committers by date:

Previous
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: When checking for datetime field overflow, we should allow a
Next
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: When checking for datetime field overflow, we should allow a