From 02a8d0c45253eb54e57b1974c8627e5be3e1d852 Mon Sep 17 00:00:00 2001 From: David Rowley Date: Fri, 20 Dec 2024 23:22:37 +1300 Subject: Remove pg_attribute.attcacheoff column The column is no longer needed as the offset is now cached in the CompactAttribute struct per commit 5983a4cff. Author: David Rowley Reviewed-by: Andres Freund, Victor Yegorov Discussion: https://postgr.es/m/CAApHDvrBztXP3yx=NKNmo3xwFAFhEdyPnvrDg3=M0RhDs+4vYw@mail.gmail.com --- src/backend/utils/cache/relcache.c | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'src/backend/utils') diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index 5658e4accbd..1ce7eb9da8f 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -661,19 +661,6 @@ RelationBuildTupleDesc(Relation relation) elog(ERROR, "pg_attribute catalog is missing %d attribute(s) for relation OID %u", need, RelationGetRelid(relation)); - /* - * The attcacheoff values we read from pg_attribute should all be -1 - * ("unknown"). Verify this if assert checking is on. - */ -#ifdef USE_ASSERT_CHECKING - { - int i; - - for (i = 0; i < RelationGetNumberOfAttributes(relation); i++) - Assert(TupleDescAttr(relation->rd_att, i)->attcacheoff == -1); - } -#endif - /* * We can easily set the attcacheoff value for the first attribute: it * must be zero. This eliminates the need for special cases for attnum=1 @@ -1964,8 +1951,6 @@ formrdesc(const char *relationName, Oid relationReltype, &attrs[i], ATTRIBUTE_FIXED_PART_SIZE); has_not_null |= attrs[i].attnotnull; - /* make sure attcacheoff is valid */ - TupleDescAttr(relation->rd_att, i)->attcacheoff = -1; populate_compact_attribute(relation->rd_att, i); } @@ -4401,8 +4386,6 @@ BuildHardcodedDescriptor(int natts, const FormData_pg_attribute *attrs) for (i = 0; i < natts; i++) { memcpy(TupleDescAttr(result, i), &attrs[i], ATTRIBUTE_FIXED_PART_SIZE); - /* make sure attcacheoff is valid */ - TupleDescAttr(result, i)->attcacheoff = -1; populate_compact_attribute(result, i); } -- cgit v1.2.3