1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-22 12:22:45 +03:00

InsertPgAttributeTuple() to set attcacheoff

InsertPgAttributeTuple() is the interface between in-memory tuple
descriptors and on-disk pg_attribute, so it makes sense to give it the
job of resetting attcacheoff.  This avoids having all the callers having
to do so.

Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
This commit is contained in:
Peter Eisentraut
2018-07-17 09:48:29 +02:00
parent 520acab171
commit e4597ee65d
3 changed files with 4 additions and 11 deletions

View File

@@ -557,12 +557,7 @@ AppendAttributeTuples(Relation indexRelation, int numatts)
{
Form_pg_attribute attr = TupleDescAttr(indexTupDesc, i);
/*
* There used to be very grotty code here to set these fields, but I
* think it's unnecessary. They should be set already.
*/
Assert(attr->attnum == i + 1);
Assert(attr->attcacheoff == -1);
InsertPgAttributeTuple(pg_attribute, attr, indstate);
}