On 16 January 2018 at 16:09, Amit Khandekar <amitdkhan.pg@gmail.com> wrote:
> I have now embedded the above incremental patch changes into the main
> patch (v37) , which is attached.
The patch had to be rebased over commit dca48d145e0e :
Remove useless lookup of root partitioned rel in ExecInitModifyTable().
In ExecInitModifyTable(), "rel" variable was needed only for INSERT.
And node->partitioned_rels is only set in UPDATE/DELETE cases, so the
extra logic of getting the root partitioned rel from
node->partitioned_rels was removed as part of that commit.
But now for update-tuple-routing, we require rel for UPDATE also. So
we need to get the root partitioned rel. But, rather than opening the
root table from node->partitioned_rels, we can re-use the
already-opened mtstate->rootResultInfo. rootResultInfo is the same as
head of partitioned_rels. I have renamed getASTriggerResultRelInfo()
to getTargetResultRelInfo(), and used it to get the root partitioned
table. The rename made sense, because it has become a function for
more general use, rather than specific to triggers-related
functionality.
Attached rebased patch.
--
Thanks,
-Amit Khandekar
EnterpriseDB Corporation
The Postgres Database Company