So ExecInsert receives the ModifyTableState, and separately it receives
arbiterIndexes and the OnConflictAction, both of which are members of
the passed ModifyTableState. I wonder why does it do that; wouldn't it
be simpler to extract those members from the node?
With the patch proposed upthread, we receive arbiterIndexes as a
parameter and if the table is a partition we summarily ignore those and
use the list as extracted from the PartitionRoutingInfo. This is
confusing and pointless. It seems to me that the logic ought to be "if
partition then use the list in PartitionRoutingInfo; if not partition
use it from ModifyTableState". This requires changing as per above,
i.e. make the arbiter index list not part of the ExecInsert's API.
The OnConflictAction doesn't matter much; not passing it is merely a
matter of cleanliness.
Or is there another reason to pass the index list?
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services