hi.
I noticed the following code pattern repeated several times in
ExecInitPartitionInfo.
```
if (part_attmap == NULL)
build_attrmap_by_name(RelationGetDescr(partrel),
RelationGetDescr(firstResultRel),
false);
```
we can consolidated into one, like:
+ if (node != NULL &&
+ (list_length(node->withCheckOptionLists) > 0 ||
+ list_length(node->returningLists) > 0 ||
+ node->onConflictAction != ONCONFLICT_NONE ||
+ node->operation == CMD_MERGE))
+ {
+ part_attmap =
+ build_attrmap_by_name(RelationGetDescr(partrel),
+ RelationGetDescr(firstResultRel),
+ false);
+ }
+
it matters, because nearby patch ON CONFLICT DO SELECT is= going to add another
one.
what do you think?
--
jian
https://www.enterprisedb.com/