memcpy(part_oids, partdesc->oids, sizeof(Oid) * nparts);
- parentDesc = CreateTupleDescCopy(RelationGetDescr(rel));
+ parentDesc = RelationGetDescr(rel);
opfamOids = palloc(sizeof(Oid) * numberOfKeyAttributes);
for (i = 0; i < numberOfKeyAttributes; i++)
opfamOids[i] = get_opclass_family(classObjectId[i]);
- table_close(rel, NoLock);
-
/*
* For each partition, scan all existing indexes; if one matches
* our index definition and is not already attached to some other
heap_freetuple(newtup);
}
}
- else
- table_close(rel, NoLock);
/*
* Indexes on partitioned tables are not themselves built, so we're
* done here.
*/
+ table_close(rel, NoLock);
if (!OidIsValid(parentIndexId))
pgstat_progress_end_command();
return address;