Skip site navigation (1) Skip section navigation (2)

pgsql: When checking for datetime field overflow, we should allow a

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: When checking for datetime field overflow, we should allow a
Date: 2009-05-01 19:29:08
Message-ID: 20090501192908.29AFE75407B@cvs.postgresql.org (view raw or flat)
Thread:
Lists: 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.

Modified Files:
--------------
    pgsql/src/backend/utils/adt:
        datetime.c (r1.203 -> r1.204)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/datetime.c?r1=1.203&r2=1.204)

pgsql-committers by date

Next:From: Tom LaneDate: 2009-05-01 19:29:13
Subject: pgsql: When checking for datetime field overflow, we should allow a
Previous:From: User ItagakiDate: 2009-05-01 09:36:20
Subject: pgbulkload - pgbulkload: Split bulkload into bulkread and bulkwrite.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group