From aeb343ec9dc90a91292c23eebc556c6b919fe9d8 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 14 Oct 2008 23:27:40 +0000 Subject: [PATCH] Make the system-attributes loop in AddNewAttributeTuples depend on lengthof(SysAtt) not FirstLowInvalidHeapAttributeNumber, for consistency with the other uses of the SysAtt array, and to make it clearer that it doesn't walk off the end of that array. --- src/backend/catalog/heap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c index 49442644c2..c299837f41 100644 --- a/src/backend/catalog/heap.c +++ b/src/backend/catalog/heap.c @@ -551,7 +551,7 @@ AddNewAttributeTuples(Oid new_rel_oid, if (relkind != RELKIND_VIEW && relkind != RELKIND_COMPOSITE_TYPE) { dpp = SysAtt; - for (i = 0; i < -1 - FirstLowInvalidHeapAttributeNumber; i++) + for (i = 0; i < (int) lengthof(SysAtt); i++, dpp++) { if (tupdesc->tdhasoid || (*dpp)->attnum != ObjectIdAttributeNumber) @@ -587,7 +587,6 @@ AddNewAttributeTuples(Oid new_rel_oid, heap_freetuple(tup); } - dpp++; } } -- 2.39.5