Fix (hopefully for the last time) problems with datetime values displaying
Tom Lane <tgl@sss.pgh.pa.us>
Fix (hopefully for the last time) problems with datetime values displaying like '23:59:60' because of fractional-second roundoff problems. Trying to control this upstream of the actual display code was hopeless; the right way is to explicitly round fractional seconds in the display code and then refigure the results if the fraction rounds up to 1. Per bug #1927.
Files
| Path | Change | +/− |
|---|---|---|
| contrib/btree_gist/btree_ts.c | modified | +0 −2 |
| src/backend/utils/adt/date.c | modified | +17 −1 |
| src/backend/utils/adt/datetime.c | modified | +4 −4 |
| src/backend/utils/adt/timestamp.c | modified | +43 −25 |
| src/include/utils/date.h | modified | +5 −1 |
| src/include/utils/timestamp.h | modified | +6 −3 |
| src/interfaces/ecpg/pgtypeslib/dt_common.c | modified | +1 −2 |
| src/interfaces/ecpg/pgtypeslib/dt.h | modified | +5 −2 |
| src/interfaces/ecpg/pgtypeslib/interval.c | modified | +9 −2 |
| src/interfaces/ecpg/pgtypeslib/timestamp.c | modified | +35 −14 |