summaryrefslogtreecommitdiff
path: root/src/interfaces
diff options
context:
space:
mode:
authorTom Lane2017-02-23 16:40:12 +0000
committerTom Lane2017-02-23 16:40:20 +0000
commitb6aa17e0ae367afdcea07118e016111af4fa6bc3 (patch)
tree54079153effacb688e0d34af0459a9205dc041c0 /src/interfaces
parentc3368f9173c13e2e293df91f75f1a5c565c4ca18 (diff)
De-support floating-point timestamps.
Per discussion, the time has come to do this. The handwriting has been on the wall at least since 9.0 that this would happen someday, whenever it got to be too much of a burden to support the float-timestamp option. The triggering factor now is the discovery that there are multiple bugs in the code that attempts to implement use of integer timestamps in the replication protocol even when the server is built for float timestamps. The internal float timestamps leak into the protocol fields in places. While we could fix the identified bugs, there's a very high risk of introducing more. Trying to build a wall that would positively prevent mixing integer and float timestamps is more complexity than we want to undertake to maintain a long-deprecated option. The fact that these bugs weren't found through testing also indicates a lack of interest in float timestamps. This commit disables configure's --disable-integer-datetimes switch (it'll still accept --enable-integer-datetimes, though), removes direct references to USE_INTEGER_DATETIMES, and removes discussion of float timestamps from the user documentation. A considerable amount of code is rendered dead by this, but removing that will occur as separate mop-up. Discussion: https://postgr.es/m/26788.1487455319@sss.pgh.pa.us
Diffstat (limited to 'src/interfaces')
-rw-r--r--src/interfaces/ecpg/include/ecpg_config.h.in4
-rw-r--r--src/interfaces/ecpg/include/pgtypes_interval.h2
-rw-r--r--src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.c6
-rw-r--r--src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.stdout2
-rw-r--r--src/interfaces/ecpg/test/pgtypeslib/dt_test2.pgc6
5 files changed, 6 insertions, 14 deletions
diff --git a/src/interfaces/ecpg/include/ecpg_config.h.in b/src/interfaces/ecpg/include/ecpg_config.h.in
index bf99a5e7930..736fb08dba3 100644
--- a/src/interfaces/ecpg/include/ecpg_config.h.in
+++ b/src/interfaces/ecpg/include/ecpg_config.h.in
@@ -10,10 +10,6 @@
/* Define to 1 if `long long int' works and is 64 bits. */
#undef HAVE_LONG_LONG_INT_64
-/* Define to 1 if you want 64-bit integer timestamp and interval support.
- (--enable-integer-datetimes) */
-#undef USE_INTEGER_DATETIMES
-
/* Define to 1 to build client libraries as thread-safe code.
* (--enable-thread-safety) */
#undef ENABLE_THREAD_SAFETY
diff --git a/src/interfaces/ecpg/include/pgtypes_interval.h b/src/interfaces/ecpg/include/pgtypes_interval.h
index deac6a2e01a..5118ec784d1 100644
--- a/src/interfaces/ecpg/include/pgtypes_interval.h
+++ b/src/interfaces/ecpg/include/pgtypes_interval.h
@@ -20,9 +20,7 @@ typedef long long int int64;
#error must have a working 64-bit integer datatype
#endif
-#ifdef USE_INTEGER_DATETIMES
#define HAVE_INT64_TIMESTAMP
-#endif
#endif /* C_H */
typedef struct
diff --git a/src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.c b/src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.c
index 4277c2615da..b6e77562b24 100644
--- a/src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.c
+++ b/src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.c
@@ -145,10 +145,8 @@ main(void)
sprintf(t, "%s %s", dates[i], times[j]);
ts1 = PGTYPEStimestamp_from_asc(t, NULL);
text = PGTYPEStimestamp_to_asc(ts1);
- /* skip outputs sensitive to USE_INTEGER_DATETIMES */
- if (i != 19 || (j != 3 && j != 4))
- printf("TS[%d,%d]: %s\n",
- i, j, errno ? "-" : text);
+ printf("TS[%d,%d]: %s\n",
+ i, j, errno ? "-" : text);
free(text);
free(t);
}
diff --git a/src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.stdout b/src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.stdout
index 941bffbd815..0fbcce67b68 100644
--- a/src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.stdout
+++ b/src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.stdout
@@ -103,6 +103,8 @@ Date[19]: 0099-01-08 BC (N - F)
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,3]: 0099-01-08 13:24:40.495 BC
+TS[19,4]: 0099-01-08 13:24:40.123456 BC
Date[20]: - (N - T)
Date[21]: - (N - T)
interval[0]: @ 1 min
diff --git a/src/interfaces/ecpg/test/pgtypeslib/dt_test2.pgc b/src/interfaces/ecpg/test/pgtypeslib/dt_test2.pgc
index 0bd1fec109d..d519305e188 100644
--- a/src/interfaces/ecpg/test/pgtypeslib/dt_test2.pgc
+++ b/src/interfaces/ecpg/test/pgtypeslib/dt_test2.pgc
@@ -110,10 +110,8 @@ main(void)
sprintf(t, "%s %s", dates[i], times[j]);
ts1 = PGTYPEStimestamp_from_asc(t, NULL);
text = PGTYPEStimestamp_to_asc(ts1);
- /* skip outputs sensitive to USE_INTEGER_DATETIMES */
- if (i != 19 || (j != 3 && j != 4))
- printf("TS[%d,%d]: %s\n",
- i, j, errno ? "-" : text);
+ printf("TS[%d,%d]: %s\n",
+ i, j, errno ? "-" : text);
free(text);
free(t);
}