summaryrefslogtreecommitdiff
path: root/src/backend/catalog/index.c
diff options
context:
space:
mode:
authorRobert Haas2022-09-28 13:45:27 +0000
committerRobert Haas2022-09-28 13:55:28 +0000
commita448e49bcbe40fb72e1ed85af910dd216d45bad8 (patch)
tree2815aed4f5e89bdea91cdd35ec89facaa846e438 /src/backend/catalog/index.c
parent6af082723277eeca74f2da65e7759666bf7c7f9c (diff)
Revert 56-bit relfilenode change and follow-up commits.
There are still some alignment-related failures in the buildfarm, which might or might not be able to be fixed quickly, but I've also just realized that it increased the size of many WAL records by 4 bytes because a block reference contains a RelFileLocator. The effect of that hasn't been studied or discussed, so revert for now.
Diffstat (limited to 'src/backend/catalog/index.c')
-rw-r--r--src/backend/catalog/index.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 1fd40c42a3a..61f1d3926a9 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -898,7 +898,12 @@ index_create(Relation heapRelation,
collationObjectId,
classObjectId);
- /* Allocate an OID for the index, unless we were told what to use. */
+ /*
+ * Allocate an OID for the index, unless we were told what to use.
+ *
+ * The OID will be the relfilenumber as well, so make sure it doesn't
+ * collide with either pg_class OIDs or existing physical files.
+ */
if (!OidIsValid(indexRelationId))
{
/* Use binary-upgrade override for pg_class.oid and relfilenumber */
@@ -930,8 +935,8 @@ index_create(Relation heapRelation,
}
else
{
- indexRelationId = GetNewOidWithIndex(pg_class, ClassOidIndexId,
- Anum_pg_class_oid);
+ indexRelationId =
+ GetNewRelFileNumber(tableSpaceId, pg_class, relpersistence);
}
}