Commit
4318daecc959886d001a6e79c6ea853e8b1dfb4b broke it. The change in
sub-second precision at extreme dates is normal. The inconsistent
truncation vs. rounding is essentially a bug, albeit a longstanding one.
Back-patch to 8.4, like the causative commit.
index 0ba1936f1db1a9aba2ea4880542fba2440cbc5dd..4277c2615dac7015e91f2b9cf22acc6f263e954a 100644 (file)
@@ -61,7 +61,7 @@ static char *times[] = { "0:04",
"1:59 PDT",
"13:24:40 -8:00",
"13:24:40.495+3",
- "13:24:40.123456789+3",
+ "13:24:40.123456123+3",
NULL };
char *intervals[] = { "1 minute",
sprintf(t, "%s %s", dates[i], times[j]);
ts1 = PGTYPEStimestamp_from_asc(t, NULL);
text = PGTYPEStimestamp_to_asc(ts1);
- if (i != 19 || j != 3) /* timestamp as integer or double differ for this case */
+ /* skip outputs sensitive to USE_INTEGER_DATETIMES */
+ if (i != 19 || (j != 3 && j != 4))
printf("TS[%d,%d]: %s\n",
i, j, errno ? "-" : text);
free(text);
index 9a4587b498e5a9692813fe6838abbac1e711981d..941bffbd8158867d40f4ecece7aa6bc7053517b8 100644 (file)
TS[19,0]: 0099年01月08日 00:04:00 BC
TS[19,1]: 0099年01月08日 01:59:00 BC
TS[19,2]: 0099年01月08日 13:24:40 BC
-TS[19,4]: 0099年01月08日 13:24:40.123456 BC
Date[20]: - (N - T)
Date[21]: - (N - T)
interval[0]: @ 1 min
index a127dd93a66cee499fd99195f355e2c5ad476a8a..0bd1fec109db9ef6b5323b6ae8ea509d862764df 100644 (file)
@@ -43,7 +43,7 @@ static char *times[] = { "0:04",
"1:59 PDT",
"13:24:40 -8:00",
"13:24:40.495+3",
- "13:24:40.123456789+3",
+ "13:24:40.123456123+3",
NULL };
char *intervals[] = { "1 minute",
sprintf(t, "%s %s", dates[i], times[j]);
ts1 = PGTYPEStimestamp_from_asc(t, NULL);
text = PGTYPEStimestamp_to_asc(ts1);
- if (i != 19 || j != 3) /* timestamp as integer or double differ for this case */
+ /* skip outputs sensitive to USE_INTEGER_DATETIMES */
+ if (i != 19 || (j != 3 && j != 4))
printf("TS[%d,%d]: %s\n",
i, j, errno ? "-" : text);
free(text);