mirror of
https://github.com/postgres/postgres.git
synced 2025-11-18 02:02:55 +03:00
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
This commit is contained in:
17
src/backend/utils/cache/relcache.c
vendored
17
src/backend/utils/cache/relcache.c
vendored
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user