Re: [HACKERS] Add support for tuple routing to foreign partitions - Mailing list pgsql-hackers

From Etsuro Fujita
Subject Re: [HACKERS] Add support for tuple routing to foreign partitions
Date
Msg-id 5A1818A7.1070302@lab.ntt.co.jp
Whole thread Raw
In response to Re: [HACKERS] Add support for tuple routing to foreign partitions  (Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>)
Responses Re: [HACKERS] Add support for tuple routing to foreign partitions
Re: [HACKERS] Add support for tuple routing to foreign partitions
List pgsql-hackers
(2017/10/27 20:00), Etsuro Fujita wrote:
> Please find attached an updated version of the patch.

Amit rebased this patch and sent me the rebased version off list. 
Thanks for that, Amit!

One thing I noticed I overlooked is about this change I added to 
make_modifytable to make a valid-looking plan node to pass to 
PlanForeignModify to plan remote insert to each foreign partition:

+               /*
+                * The column list of the child might have a different 
column
+                * order and/or a different set of dropped columns than that
+                * of its parent, so adjust the subplan's tlist as well.
+                */
+               tlist = preprocess_targetlist(root,
+                                             child_parse->targetList);

This would be needed because the FDW might reference the tlist.  Since 
preprocess_targetlist references root->parse, it's needed to replace 
that with the child query before calling that function, but I forgot to 
do that.  So I fixed that.  Attached is an updated version of the patch.

Best regards,
Etsuro Fujita

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [HACKERS] Cache lookup errors with functions manipulation object addresses
Next
From: Antonin Houska
Date:
Subject: Re: [HACKERS] Transactions involving multiple postgres foreign servers