v16-0001-Disable-updating-pg_class-for-CREATE-INDEX-durin.patch
text/x-patch
Filename: v16-0001-Disable-updating-pg_class-for-CREATE-INDEX-durin.patch
Type: text/x-patch
Part: 0
Message:
Re: Statistics Import and Export
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: format-patch
Series: patch v16-0001
Subject: Disable updating pg_class for CREATE INDEX during binary upgrade.
| File | + | − |
|---|---|---|
| src/backend/catalog/index.c | 2 | 1 |
From d98a95243fd3114af96fc69126581ca591df9556 Mon Sep 17 00:00:00 2001
From: Corey Huinker <corey.huinker@gmail.com>
Date: Wed, 3 Apr 2024 00:48:03 -0400
Subject: [PATCH v16 1/3] Disable updating pg_class for CREATE INDEX during
binary upgrade.
There is no point in setting these values because the table will always
be empty.
---
src/backend/catalog/index.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index b6a7c60e23..67d6bf0342 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -2874,7 +2874,8 @@ index_update_stats(Relation rel,
dirty = true;
}
- if (reltuples >= 0)
+ /* During binary upgrade, tables are always empty. */
+ if ((reltuples >= 0) && (!IsBinaryUpgrade))
{
BlockNumber relpages = RelationGetNumberOfBlocks(rel);
BlockNumber relallvisible;
--
2.44.0