Re: [HACKERS] Useless code in ExecInitModifyTable - Mailing list pgsql-hackers

From Amit Langote
Subject Re: [HACKERS] Useless code in ExecInitModifyTable
Date
Msg-id e7ff65ef-3ca0-818e-18f3-9512c139be94@lab.ntt.co.jp
Whole thread Raw
In response to Re: [HACKERS] Useless code in ExecInitModifyTable  (Amit Khandekar <amitdkhan.pg@gmail.com>)
List pgsql-hackers
On 2018/01/19 18:50, Amit Khandekar wrote:
> FYI ...
> 
> For the pending update-partition-key patch, we would again require the
> rel variable for UPDATE. So in the rebased update-partition-key patch
> [1], 'rel' is assigned the root partitioned table. But this time, I
> have used the already opened node->rootResultRelInfo to get the root
> partitioned table, rather than opening it again. Details : [1] . Sorry
> for not noticing this potential conflict earlier. Comments welcome.
> 
> [1] : https://www.postgresql.org/message-id/CAJ3gD9cpyM1L0vTrXzrggR%3Dt6MSZtuy_kge1kagMBi0TSKa_UQ%40mail.gmail.com

That's nice.  Actually, the rootResultRelInfo field was introduced [1]
after partitioned_rels [2] and the code that got removed with the patch
that was committed should have gone much earlier.  That is, when
rootResultRelInfo was introduced, but then again as Fujita-san pointed
out, there wasn't much point then (and now) to finding the root table's
Relation pointer in some special place.  But now we need to, for the
update tuple routing case as you said.

Thanks,
Amit

[1]
https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=e180c8aa8ca

[2]
https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=d3cc37f1d801



pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Rangejoin rebased
Next
From: Simon Riggs
Date:
Subject: Re: [PATCH] session_replication_role = replica with TRUNCATE