Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2017-02-23 17:23:12 +0000
committerTom Lane2017-02-23 17:23:12 +0000
commitd28aafb6dda326688e2f042c95c93ea57963c03c (patch)
tree530fb08d5f3250b541996e0aa21930fa4684d07a /src/backend
parentb6aa17e0ae367afdcea07118e016111af4fa6bc3 (diff)
Remove pg_control's enableIntTimes field.
We don't need it any more. pg_controldata continues to report that date/time type storage is "64-bit integers", but that's now a hard-wired behavior not something it sees in the data. This avoids breaking pg_upgrade, and perhaps other utilities that inspect pg_control this way. Ditto for pg_resetwal. I chose to remove the "bigint_timestamps" output column of pg_control_init(), though, as that function hasn't been around long and probably doesn't have ossified users. Discussion: https://postgr.es/m/26788.1487455319@sss.pgh.pa.us
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/access/transam/xlog.c21
-rw-r--r--src/backend/utils/misc/pg_controldata.c23
2 files changed, 9 insertions, 35 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index f23e1086280..ebae9da0f85 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -4379,11 +4379,6 @@ WriteControlFile(void)
ControlFile->toast_max_chunk_size = TOAST_MAX_CHUNK_SIZE;
ControlFile->loblksize = LOBLKSIZE;
-#ifdef HAVE_INT64_TIMESTAMP
- ControlFile->enableIntTimes = true;
-#else
- ControlFile->enableIntTimes = false;
-#endif
ControlFile->float4ByVal = FLOAT4PASSBYVAL;
ControlFile->float8ByVal = FLOAT8PASSBYVAL;
@@ -4579,22 +4574,6 @@ ReadControlFile(void)
ControlFile->loblksize, (int) LOBLKSIZE),
errhint("It looks like you need to recompile or initdb.")));
-#ifdef HAVE_INT64_TIMESTAMP
- if (ControlFile->enableIntTimes != true)
- ereport(FATAL,
- (errmsg("database files are incompatible with server"),
- errdetail("The database cluster was initialized without HAVE_INT64_TIMESTAMP"
- " but the server was compiled with HAVE_INT64_TIMESTAMP."),
- errhint("It looks like you need to recompile or initdb.")));
-#else
- if (ControlFile->enableIntTimes != false)
- ereport(FATAL,
- (errmsg("database files are incompatible with server"),
- errdetail("The database cluster was initialized with HAVE_INT64_TIMESTAMP"
- " but the server was compiled without HAVE_INT64_TIMESTAMP."),
- errhint("It looks like you need to recompile or initdb.")));
-#endif
-
#ifdef USE_FLOAT4_BYVAL
if (ControlFile->float4ByVal != true)
ereport(FATAL,
diff --git a/src/backend/utils/misc/pg_controldata.c b/src/backend/utils/misc/pg_controldata.c
index 93a3d38b1d0..d8454111a89 100644
--- a/src/backend/utils/misc/pg_controldata.c
+++ b/src/backend/utils/misc/pg_controldata.c
@@ -266,8 +266,8 @@ pg_control_recovery(PG_FUNCTION_ARGS)
Datum
pg_control_init(PG_FUNCTION_ARGS)
{
- Datum values[13];
- bool nulls[13];
+ Datum values[12];
+ bool nulls[12];
TupleDesc tupdesc;
HeapTuple htup;
ControlFileData *ControlFile;
@@ -277,7 +277,7 @@ pg_control_init(PG_FUNCTION_ARGS)
* Construct a tuple descriptor for the result row. This must match this
* function's pg_proc entry!
*/
- tupdesc = CreateTemplateTupleDesc(13, false);
+ tupdesc = CreateTemplateTupleDesc(12, false);
TupleDescInitEntry(tupdesc, (AttrNumber) 1, "max_data_alignment",
INT4OID, -1, 0);
TupleDescInitEntry(tupdesc, (AttrNumber) 2, "database_block_size",
@@ -296,13 +296,11 @@ pg_control_init(PG_FUNCTION_ARGS)
INT4OID, -1, 0);
TupleDescInitEntry(tupdesc, (AttrNumber) 9, "large_object_chunk_size",
INT4OID, -1, 0);
- TupleDescInitEntry(tupdesc, (AttrNumber) 10, "bigint_timestamps",
+ TupleDescInitEntry(tupdesc, (AttrNumber) 10, "float4_pass_by_value",
BOOLOID, -1, 0);
- TupleDescInitEntry(tupdesc, (AttrNumber) 11, "float4_pass_by_value",
+ TupleDescInitEntry(tupdesc, (AttrNumber) 11, "float8_pass_by_value",
BOOLOID, -1, 0);
- TupleDescInitEntry(tupdesc, (AttrNumber) 12, "float8_pass_by_value",
- BOOLOID, -1, 0);
- TupleDescInitEntry(tupdesc, (AttrNumber) 13, "data_page_checksum_version",
+ TupleDescInitEntry(tupdesc, (AttrNumber) 12, "data_page_checksum_version",
INT4OID, -1, 0);
tupdesc = BlessTupleDesc(tupdesc);
@@ -339,18 +337,15 @@ pg_control_init(PG_FUNCTION_ARGS)
values[8] = Int32GetDatum(ControlFile->loblksize);
nulls[8] = false;
- values[9] = BoolGetDatum(ControlFile->enableIntTimes);
+ values[9] = BoolGetDatum(ControlFile->float4ByVal);
nulls[9] = false;
- values[10] = BoolGetDatum(ControlFile->float4ByVal);
+ values[10] = BoolGetDatum(ControlFile->float8ByVal);
nulls[10] = false;
- values[11] = BoolGetDatum(ControlFile->float8ByVal);
+ values[11] = Int32GetDatum(ControlFile->data_checksum_version);
nulls[11] = false;
- values[12] = Int32GetDatum(ControlFile->data_checksum_version);
- nulls[12] = false;
-
htup = heap_form_tuple(tupdesc, values, nulls);
PG_RETURN_DATUM(HeapTupleGetDatum(htup));