@@ -1206,7 +1206,8 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId,
1206
1206
}
1207
1207
1208
1208
attmap = build_attrmap_by_name(RelationGetDescr(rel),
1209
- RelationGetDescr(parent));
1209
+ RelationGetDescr(parent),
1210
+ false);
1210
1211
idxstmt =
1211
1212
generateClonedIndexStmt(NULL, idxRel,
1212
1213
attmap, &constraintOid);
@@ -9647,7 +9648,8 @@ addFkRecurseReferenced(List **wqueue, Constraint *fkconstraint, Relation rel,
9647
9648
* definition to match the partition's column layout.
9648
9649
*/
9649
9650
map = build_attrmap_by_name_if_req(RelationGetDescr(partRel),
9650
- RelationGetDescr(pkrel));
9651
+ RelationGetDescr(pkrel),
9652
+ false);
9651
9653
if (map)
9652
9654
{
9653
9655
mapped_pkattnum = palloc(sizeof(AttrNumber) * numfks);
@@ -9814,7 +9816,8 @@ addFkRecurseReferencing(List **wqueue, Constraint *fkconstraint, Relation rel,
9814
9816
CheckTableNotInUse(partition, "ALTER TABLE");
9815
9817
9816
9818
attmap = build_attrmap_by_name(RelationGetDescr(partition),
9817
- RelationGetDescr(rel));
9819
+ RelationGetDescr(rel),
9820
+ false);
9818
9821
for (int j = 0; j < numfks; j++)
9819
9822
mapped_fkattnum[j] = attmap->attnums[fkattnum[j] - 1];
9820
9823
@@ -10022,7 +10025,8 @@ CloneFkReferenced(Relation parentRel, Relation partitionRel)
10022
10025
trigrel = table_open(TriggerRelationId, RowExclusiveLock);
10023
10026
10024
10027
attmap = build_attrmap_by_name(RelationGetDescr(partitionRel),
10025
- RelationGetDescr(parentRel));
10028
+ RelationGetDescr(parentRel),
10029
+ false);
10026
10030
foreach(cell, clone)
10027
10031
{
10028
10032
Oid constrOid = lfirst_oid(cell);
@@ -10219,7 +10223,8 @@ CloneFkReferencing(List **wqueue, Relation parentRel, Relation partRel)
10219
10223
* different. This map is used to convert them.
10220
10224
*/
10221
10225
attmap = build_attrmap_by_name(RelationGetDescr(partRel),
10222
- RelationGetDescr(parentRel));
10226
+ RelationGetDescr(parentRel),
10227
+ false);
10223
10228
10224
10229
partFKs = copyObject(RelationGetFKeyList(partRel));
10225
10230
@@ -12335,7 +12340,8 @@ ATPrepAlterColumnType(List **wqueue,
12335
12340
cmd = copyObject(cmd);
12336
12341
12337
12342
attmap = build_attrmap_by_name(RelationGetDescr(childrel),
12338
- RelationGetDescr(rel));
12343
+ RelationGetDescr(rel),
12344
+ false);
12339
12345
((ColumnDef *) cmd->def)->cooked_default =
12340
12346
map_variable_attnos(def->cooked_default,
12341
12347
1, 0,
@@ -18043,7 +18049,8 @@ AttachPartitionEnsureIndexes(Relation rel, Relation attachrel)
18043
18049
/* construct an indexinfo to compare existing indexes against */
18044
18050
info = BuildIndexInfo(idxRel);
18045
18051
attmap = build_attrmap_by_name(RelationGetDescr(attachrel),
18046
- RelationGetDescr(rel));
18052
+ RelationGetDescr(rel),
18053
+ false);
18047
18054
constraintOid = get_relation_idx_constraint_oid(RelationGetRelid(rel), idx);
18048
18055
18049
18056
/*
@@ -18981,7 +18988,8 @@ ATExecAttachPartitionIdx(List **wqueue, Relation parentIdx, RangeVar *name)
18981
18988
childInfo = BuildIndexInfo(partIdx);
18982
18989
parentInfo = BuildIndexInfo(parentIdx);
18983
18990
attmap = build_attrmap_by_name(RelationGetDescr(partTbl),
18984
- RelationGetDescr(parentTbl));
18991
+ RelationGetDescr(parentTbl),
18992
+ false);
18985
18993
if (!CompareIndexInfo(childInfo, parentInfo,
18986
18994
partIdx->rd_indcollation,
18987
18995
parentIdx->rd_indcollation,
0 commit comments