@@ -1206,7 +1206,8 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId,
12061206 }
12071207
12081208 attmap = build_attrmap_by_name(RelationGetDescr(rel),
1209- RelationGetDescr(parent));
1209+ RelationGetDescr(parent),
1210+ false);
12101211 idxstmt =
12111212 generateClonedIndexStmt(NULL, idxRel,
12121213 attmap, &constraintOid);
@@ -9647,7 +9648,8 @@ addFkRecurseReferenced(List **wqueue, Constraint *fkconstraint, Relation rel,
96479648 * definition to match the partition's column layout.
96489649 */
96499650 map = build_attrmap_by_name_if_req(RelationGetDescr(partRel),
9650- RelationGetDescr(pkrel));
9651+ RelationGetDescr(pkrel),
9652+ false);
96519653 if (map)
96529654 {
96539655 mapped_pkattnum = palloc(sizeof(AttrNumber) * numfks);
@@ -9814,7 +9816,8 @@ addFkRecurseReferencing(List **wqueue, Constraint *fkconstraint, Relation rel,
98149816 CheckTableNotInUse(partition, "ALTER TABLE");
98159817
98169818 attmap = build_attrmap_by_name(RelationGetDescr(partition),
9817- RelationGetDescr(rel));
9819+ RelationGetDescr(rel),
9820+ false);
98189821 for (int j = 0; j < numfks; j++)
98199822 mapped_fkattnum[j] = attmap->attnums[fkattnum[j] - 1];
98209823
@@ -10022,7 +10025,8 @@ CloneFkReferenced(Relation parentRel, Relation partitionRel)
1002210025 trigrel = table_open(TriggerRelationId, RowExclusiveLock);
1002310026
1002410027 attmap = build_attrmap_by_name(RelationGetDescr(partitionRel),
10025- RelationGetDescr(parentRel));
10028+ RelationGetDescr(parentRel),
10029+ false);
1002610030 foreach(cell, clone)
1002710031 {
1002810032 Oid constrOid = lfirst_oid(cell);
@@ -10219,7 +10223,8 @@ CloneFkReferencing(List **wqueue, Relation parentRel, Relation partRel)
1021910223 * different. This map is used to convert them.
1022010224 */
1022110225 attmap = build_attrmap_by_name(RelationGetDescr(partRel),
10222- RelationGetDescr(parentRel));
10226+ RelationGetDescr(parentRel),
10227+ false);
1022310228
1022410229 partFKs = copyObject(RelationGetFKeyList(partRel));
1022510230
@@ -12335,7 +12340,8 @@ ATPrepAlterColumnType(List **wqueue,
1233512340 cmd = copyObject(cmd);
1233612341
1233712342 attmap = build_attrmap_by_name(RelationGetDescr(childrel),
12338- RelationGetDescr(rel));
12343+ RelationGetDescr(rel),
12344+ false);
1233912345 ((ColumnDef *) cmd->def)->cooked_default =
1234012346 map_variable_attnos(def->cooked_default,
1234112347 1, 0,
@@ -18043,7 +18049,8 @@ AttachPartitionEnsureIndexes(Relation rel, Relation attachrel)
1804318049 /* construct an indexinfo to compare existing indexes against */
1804418050 info = BuildIndexInfo(idxRel);
1804518051 attmap = build_attrmap_by_name(RelationGetDescr(attachrel),
18046- RelationGetDescr(rel));
18052+ RelationGetDescr(rel),
18053+ false);
1804718054 constraintOid = get_relation_idx_constraint_oid(RelationGetRelid(rel), idx);
1804818055
1804918056 /*
@@ -18981,7 +18988,8 @@ ATExecAttachPartitionIdx(List **wqueue, Relation parentIdx, RangeVar *name)
1898118988 childInfo = BuildIndexInfo(partIdx);
1898218989 parentInfo = BuildIndexInfo(parentIdx);
1898318990 attmap = build_attrmap_by_name(RelationGetDescr(partTbl),
18984- RelationGetDescr(parentTbl));
18991+ RelationGetDescr(parentTbl),
18992+ false);
1898518993 if (!CompareIndexInfo(childInfo, parentInfo,
1898618994 partIdx->rd_indcollation,
1898718995 parentIdx->rd_indcollation,
0 commit comments