summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTeodor Sigaev2018-04-19 08:28:03 +0000
committerTeodor Sigaev2018-04-19 08:28:03 +0000
commitff4943042f9761fb4e84432da563f43eb3559a3b (patch)
tree4f7fe8e130214e7e8bcca65bbe5f7a4bdfa2af4c
parentf97f0c921ae56bb16e466f3c9d6c504f4a96a539 (diff)
Fix datatype for number of heap tuples during last cleanup
It appears that new fields introduced in 857f9c36 have inconsistent datatypes: BTMetaPageData.btm_last_cleanup_num_heap_tuples is of float4 type, while xl_btree_metadata.last_cleanup_num_heap_tuples is of double type. IndexVacuumInfo.num_heap_tuples, which is a source of values for both former fields is of double type. So, make both those fields in BTMetaPageData and xl_btree_metadata use float8 type in order to match the precision of the source. That shouldn't be double type, because we always use types with explicit width in WAL. Patch introduces incompatibility of on-disk format since 857f9c36 commit, but that versions never was released, so just bump catalog version to avoid possible confusion. Author: Alexander Korortkov
-rw-r--r--src/include/access/nbtree.h2
-rw-r--r--src/include/access/nbtxlog.h2
-rw-r--r--src/include/catalog/catversion.h2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/include/access/nbtree.h b/src/include/access/nbtree.h
index 7aa6afbbb8..1194be9281 100644
--- a/src/include/access/nbtree.h
+++ b/src/include/access/nbtree.h
@@ -105,7 +105,7 @@ typedef struct BTMetaPageData
/* following fields are available since page version 3 */
TransactionId btm_oldest_btpo_xact; /* oldest btpo_xact among of
* deleted pages */
- float4 btm_last_cleanup_num_heap_tuples; /* number of heap tuples
+ float8 btm_last_cleanup_num_heap_tuples; /* number of heap tuples
* during last cleanup */
} BTMetaPageData;
diff --git a/src/include/access/nbtxlog.h b/src/include/access/nbtxlog.h
index c55b618ff7..819373031c 100644
--- a/src/include/access/nbtxlog.h
+++ b/src/include/access/nbtxlog.h
@@ -52,7 +52,7 @@ typedef struct xl_btree_metadata
BlockNumber fastroot;
uint32 fastlevel;
TransactionId oldest_btpo_xact;
- double last_cleanup_num_heap_tuples;
+ float8 last_cleanup_num_heap_tuples;
} xl_btree_metadata;
/*
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h
index acd6791563..2954cba6b3 100644
--- a/src/include/catalog/catversion.h
+++ b/src/include/catalog/catversion.h
@@ -53,6 +53,6 @@
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 201804091
+#define CATALOG_VERSION_NO 201804191
#endif