summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/catalog/index.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index b6a7c60e230..9b7ef71d6fe 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -2874,7 +2874,11 @@ index_update_stats(Relation rel,
dirty = true;
}
- if (reltuples >= 0)
+ /*
+ * Avoid updating statistics during binary upgrade, because the indexes
+ * are created before the data is moved into place.
+ */
+ if (reltuples >= 0 && !IsBinaryUpgrade)
{
BlockNumber relpages = RelationGetNumberOfBlocks(rel);
BlockNumber relallvisible;